Python drf_yasg.openapi.Schema() Examples
The following are 2
code examples of drf_yasg.openapi.Schema().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
drf_yasg.openapi
, or try the search function
.
Example #1
Source File: inspector.py From aries-vcr with Apache License 2.0 | 6 votes |
def get_paginated_response(self, paginator, response_schema): paged_schema = openapi.Schema( type=openapi.TYPE_OBJECT, properties=OrderedDict(( ("total", openapi.Schema(type=openapi.TYPE_INTEGER)), ("page_size", openapi.Schema(type=openapi.TYPE_INTEGER)), ("page", openapi.Schema(type=openapi.TYPE_INTEGER)), ("first_index", openapi.Schema(type=openapi.TYPE_INTEGER)), ("last_index", openapi.Schema(type=openapi.TYPE_INTEGER)), ("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'] ) return paged_schema
Example #2
Source File: inspector.py From TheOrgBook with Apache License 2.0 | 6 votes |
def get_paginated_response(self, paginator, response_schema): paged_schema = openapi.Schema( type=openapi.TYPE_OBJECT, properties=OrderedDict(( ("total", openapi.Schema(type=openapi.TYPE_INTEGER)), ("page_size", openapi.Schema(type=openapi.TYPE_INTEGER)), ("page", openapi.Schema(type=openapi.TYPE_INTEGER)), ("first_index", openapi.Schema(type=openapi.TYPE_INTEGER)), ("last_index", openapi.Schema(type=openapi.TYPE_INTEGER)), ("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'] ) return paged_schema