django-rest-framework/rest_framework/schemas
Reupen Shah f8c16441fa Add support for pagination in OpenAPI response schemas (#6867)
Refs #6846

This provides a way for pagination classes to add pagination properties (`count`, `next`, `results` etc.) to OpenAPI response schemas.

A new method `get_paginated_response_schema()` has been added to `BasePagination`. This method is intended to mirror `get_paginated_response()` (which takes a `list` and wraps it in a `dict`). 

Hence, `get_paginated_response_schema()` takes an unpaginated response schema (of type `array`) and wraps that with a schema object of type `object` containing the relevant properties that the pagination class adds to responses.

The default implementation of `BasePagination.get_paginated_response_schema()` simply passes the schema through unmodified, for backwards compatibility.
2019-09-03 15:25:44 +02:00
..
__init__.py Added OpenAPI Schema Generation. (#6532) 2019-05-13 16:07:03 +02:00
coreapi.py replace force_text with force_str 2019-08-07 21:05:24 +02:00
generators.py Move determine_path_prefix() logic into CoreAPI module. 2019-07-24 11:13:30 +02:00
inspectors.py Added OpenAPI Schema Generation. (#6532) 2019-05-13 16:07:03 +02:00
openapi.py Add support for pagination in OpenAPI response schemas (#6867) 2019-09-03 15:25:44 +02:00
utils.py Added OpenAPI Schema Generation. (#6532) 2019-05-13 16:07:03 +02:00
views.py Added OpenAPI Schema Generation. (#6532) 2019-05-13 16:07:03 +02:00