We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi
Let's say i have a view like this one:
class BookViewSet(viewsets.ModelViewSet): queryset = Book.objects.all() serializer_class = serializers.BookSerializer @extend_schema( responses={200: inline_serializer( name='TitleSerializer', fields={'title': rest_serializers.CharField()}, many=True )} ) @action(methods=["GET"], detail=True) def get_title(self, request, *args, **kwargs): return Response() @extend_schema( responses={200: inline_serializer( name='GenreSerializer', fields={'genre': rest_serializers.CharField()}, many=True )} ) @action(methods=["GET"], detail=True) def get_genre(self, request, *args, **kwargs): return Response()
Here the schema is correct: But here is not:
Must be:
{ "count": 123, "next": "http://api.example.org/accounts/?offset=400&limit=100", "previous": "http://api.example.org/accounts/?offset=200&limit=100", "results": [ { "genre": "string" } ] }
Settings:
REST_FRAMEWORK = { 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema', 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', }
SPECTACULAR_SETTINGS = { 'SWAGGER_UI_SETTINGS': { 'filter': True, "displayOperationId": True, }, 'TITLE': 'MY PROJECT SETTINGS', 'VERSION': '1.1.1', }
Can you help me? or I'm missing something?
The text was updated successfully, but these errors were encountered:
hi @LesPrimus. your example looks fine. it looks like a bug that happens only with pagination. i'll investigate.
Sorry, something went wrong.
bugfix naming for ListSerializer with pagination #183
244be7a
that should fix it. small oversight in name generation for many=True aka ListSerializer
many=True
ListSerializer
please confirm and close issue if resolved.
Confirm... Thanks so much!
No branches or pull requests
Hi
Let's say i have a view like this one:
Here the schema is correct:
But here is not:
Must be:
Settings:
Can you help me? or I'm missing something?
The text was updated successfully, but these errors were encountered: