Fix: Pagination response schemas. (#9049)

This commit is contained in:
Sergey Klyuykov 2023-07-15 02:26:56 -07:00 committed by GitHub
parent 66d86d0177
commit 7658ffd71d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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',

View File

@ -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',