DRF 3.6: How to document input parameters in APIView (for automatic doc generation)?
django, django-rest-framework
Solution
I Got the answer from Tom Christie:
`serializer_class` by itself isn't enough - the view needs to implement get_serializer, see: https://github.com/encode/django-rest-framework/blob/master/rest_framework/schemas.py#L570
So in My case, adding this works well:
def get_serializer(self):
return ActivateCustomerSerializer()
Problem
I'm struggling with DRF 3.6 auto-generated interactive documentation to provide input parameters to fill in interactive mode. As a result, I get an empty windows for my POST request (which would require 3 parameters actually): With Swagger, I could do it directly in docstring with some YAML. Now, after browsing DRF documentation, I can't find the way to do it. ``` class ActivateCustomerView(APIView): permission_classes = (AllowAny,) def post(self, request): """ View dedicated to activating a pre-recorded customer # Should I add some parameters here? """ serializer = ActivateCustomerSerializer(data=request.data) serializer.is_valid(raise_exception=True) # ... ```