Add x-nullable to paginator response fields

Closes #263.
master
Cristi Vîjdea 2018-12-19 19:34:40 +02:00
parent f8e9fd6327
commit e182ab65ea
2 changed files with 4 additions and 2 deletions

View File

@ -71,8 +71,8 @@ class DjangoRestResponsePagination(PaginatorInspector):
type=openapi.TYPE_OBJECT,
properties=OrderedDict((
('count', openapi.Schema(type=openapi.TYPE_INTEGER) if has_count else None),
('next', openapi.Schema(type=openapi.TYPE_STRING, format=openapi.FORMAT_URI)),
('previous', openapi.Schema(type=openapi.TYPE_STRING, format=openapi.FORMAT_URI)),
('next', openapi.Schema(type=openapi.TYPE_STRING, format=openapi.FORMAT_URI, x_nullable=True)),
('previous', openapi.Schema(type=openapi.TYPE_STRING, format=openapi.FORMAT_URI, x_nullable=True)),
('results', response_schema),
)),
required=['results']

View File

@ -75,9 +75,11 @@ paths:
next:
type: string
format: uri
x-nullable: true
previous:
type: string
format: uri
x-nullable: true
results:
type: array
items: