drf-yasg
drf-yasg copied to clipboard
customized pagination class is not support?
I'm using pagination_class = newPagination
in the view file.
1.newPagination is a customized class base on rest_framework.pagination.PageNumberPagination
.(override func get_paginated_response
)
2.I got correct Respons result in web test.
3.drf-yasg
shows the Respons result by the original rest_framework.pagination.PageNumberPagination.get_paginated_response()
.(override func is not work)
I also encountered the same problem
Same here, doesn't seem to support it. Probably this here: https://github.com/axnsan12/drf-yasg/blob/b99306f71c6a5779b62189df7d9c1f5ea1c794ef/src/drf_yasg/inspectors/query.py#L60-L79
@axnsan12 Could you please take a look at this?
You can write your own PaginationInspector
subclass and make DRF use it, either through the DEFAULT_PAGINATION_INSPECTOR
setting or as an argument to swagger_auto_schema
.
@axnsan12 Could you please confirm this or propose a solution?
@axnsan12 Hi, could you please take a look?
Weird. I would have expected it to generate the schema based on the results of paginator.get_paginated_response_schema()
, not hardcoded for the three base types provided by DRF. Spent a day to debug why my custom get_paginated_response_schema()
wasn't getting called at all when accessing the docs.