[Answer]-How to pass in a list of arguments to a custom Django REST Framework API?

1👍

✅

According to the django rest framework documentation:

http://www.django-rest-framework.org/api-guide/fields

on the Third party packages section, DRF Compound Fields does the job, you can find more info here: https://github.com/estebistec/drf-compound-fields

but in this case would be:

from drf_compound_fields.fields import ListField

class MySerializer(serializers.Serializer):
    ...
    my_list_of_integers = ListField(serializers.IntegerField())

regards

Leave a comment