django-rest-framework/tests/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
test_coreapi.py Added OpenAPI Schema Generation. (#6532) 2019-05-13 16:07:03 +02:00
test_get_schema_view.py Added OpenAPI Schema Generation. (#6532) 2019-05-13 16:07:03 +02:00
test_managementcommand.py Add --generator_class CLI option to generateschema (#6735) 2019-06-09 14:43:54 +02:00
test_openapi.py Add support for pagination in OpenAPI response schemas (#6867) 2019-09-03 15:25:44 +02:00
views.py Fixed a typo on the ExampleValidatedAPIView 2019-07-24 11:13:30 +02:00