Fix swagger API docs generation - #1366
Merged
Merged
Conversation
- Use `extend_schema` to override the request body, which was not being properly discovered. - drf-spectacular relies on `get_serializer_class()` and `get_serializer()`, and it works well for view functions that purely deal with ModelSerializer. For anything else, it gets a bit murky, and it is advised to provide proper overrides in the `extend_schema` decorator. - Override erroneous pagination and filter backend caused due to response containing multiple serializer object https://drf-spectacular.readthedocs.io/en/latest/faq.html#my-action-is-erroneously-paginated-or-has-filter-parameters-that-i-do-not-want Signed-off-by: Keshav Priyadarshi <git@keshav.space>
TG1999
requested changes
Dec 14, 2023
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
TG1999
reviewed
Dec 14, 2023
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
TG1999
requested changes
Dec 14, 2023
TG1999
left a comment
Contributor
There was a problem hiding this comment.
@keshav-space thanks! can you also check for lookup and bulk_lookup endpoint as well
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
api/packages/bulk_search/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
extend_schemato override the request body, which was not being properly discovered.drf-spectacular relies on
get_serializer_class()andget_serializer(), and it works well for view functions that purely deal with ModelSerializer. For anything else, it gets a bit murky, and it is advised to provide proper overrides in theextend_schemadecorator.Override erroneous pagination and filter backend caused due to response containing multiple serializer object https://drf-spectacular.readthedocs.io/en/latest/faq.html#my-action-is-erroneously-paginated-or-has-filter-parameters-that-i-do-not-want