When generating OpenAPI documentation, additional headers in the response decorator are overwritten whenever the paginate decorator is used. This appears to be caused by the _document_pagination_metadata in pagination.py which overwrites the resp_doc["headers"] structure.
A simple fix could be something like this:
def _document_pagination_metadata(self, spec, resp_doc):
"""Document pagination metadata header
Override this to document custom pagination metadata
"""
if "headers" not in resp_doc:
resp_doc["headers"] = {}
resp_doc["headers"].update({
self.PAGINATION_HEADER_NAME: "PAGINATION"
if spec.openapi_version.major >= 3
else PAGINATION_HEADER
})
When generating OpenAPI documentation, additional headers in the response decorator are overwritten whenever the paginate decorator is used. This appears to be caused by the
_document_pagination_metadata
inpagination.py
which overwrites theresp_doc["headers"]
structure.A simple fix could be something like this: