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
Sometimes, drf-yasg can't figure out the appropriate serializer for a class. That's not a problem if we have a serializer on hand to pass to schema:
drf-yasg
schema
@schema(responses={200: MySerializer}) def get(...): """ My view """
For paginated views, this becomes a problem, because we don't have a paginated serializer to give schema.
I see two solutions to this:
Why can't drf-yasg generate a correct paginated response schema? Are we missing a class variable on our views? Are we using DRF wrong?
In the case where drf-yasg just can't figure out the response schema, it'd be great to be able to do something like:
@schema(responses={200: paginate_serializer(MySerializer, MyPaginationClass)}) def get(...): """ My paginated view """
The text was updated successfully, but these errors were encountered:
This PR would provide paginate_serializer for edx-platform, but it'd be better to add this at the api-doc-tools level.
Sorry, something went wrong.
No branches or pull requests
Sometimes,
drf-yasg
can't figure out the appropriate serializer for a class. That's not a problem if we have a serializer on hand to pass toschema
:For paginated views, this becomes a problem, because we don't have a paginated serializer to give
schema
.I see two solutions to this:
1. Help drf-yasg figure out paginated serializers better
Why can't drf-yasg generate a correct paginated response schema? Are we missing a class variable on our views? Are we using DRF wrong?
2. Provide a manual paginate_serializer function as a fall-back
In the case where drf-yasg just can't figure out the response schema, it'd be great to be able to do something like:
The text was updated successfully, but these errors were encountered: