mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 01:26:53 +03:00
Fix: Pagination response schemas. (#9049)
This commit is contained in:
parent
66d86d0177
commit
7658ffd71d
|
@ -239,6 +239,7 @@ class PageNumberPagination(BasePagination):
|
|||
def get_paginated_response_schema(self, schema):
|
||||
return {
|
||||
'type': 'object',
|
||||
'required': ['count', 'results'],
|
||||
'properties': {
|
||||
'count': {
|
||||
'type': 'integer',
|
||||
|
@ -411,6 +412,7 @@ class LimitOffsetPagination(BasePagination):
|
|||
def get_paginated_response_schema(self, schema):
|
||||
return {
|
||||
'type': 'object',
|
||||
'required': ['count', 'results'],
|
||||
'properties': {
|
||||
'count': {
|
||||
'type': 'integer',
|
||||
|
@ -906,6 +908,7 @@ class CursorPagination(BasePagination):
|
|||
def get_paginated_response_schema(self, schema):
|
||||
return {
|
||||
'type': 'object',
|
||||
'required': ['results'],
|
||||
'properties': {
|
||||
'next': {
|
||||
'type': 'string',
|
||||
|
|
|
@ -274,6 +274,7 @@ class TestPageNumberPagination:
|
|||
|
||||
assert self.pagination.get_paginated_response_schema(unpaginated_schema) == {
|
||||
'type': 'object',
|
||||
'required': ['count', 'results'],
|
||||
'properties': {
|
||||
'count': {
|
||||
'type': 'integer',
|
||||
|
@ -585,6 +586,7 @@ class TestLimitOffset:
|
|||
|
||||
assert self.pagination.get_paginated_response_schema(unpaginated_schema) == {
|
||||
'type': 'object',
|
||||
'required': ['count', 'results'],
|
||||
'properties': {
|
||||
'count': {
|
||||
'type': 'integer',
|
||||
|
@ -937,6 +939,7 @@ class CursorPaginationTestsMixin:
|
|||
|
||||
assert self.pagination.get_paginated_response_schema(unpaginated_schema) == {
|
||||
'type': 'object',
|
||||
'required': ['results'],
|
||||
'properties': {
|
||||
'next': {
|
||||
'type': 'string',
|
||||
|
|
Loading…
Reference in New Issue
Block a user