本文整理汇总了Python中drf_yasg.openapi.TYPE_STRING属性的典型用法代码示例。如果您正苦于以下问题:Python openapi.TYPE_STRING属性的具体用法?Python openapi.TYPE_STRING怎么用?Python openapi.TYPE_STRING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类drf_yasg.openapi
的用法示例。
在下文中一共展示了openapi.TYPE_STRING属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_paginated_response
# 需要导入模块: from drf_yasg import openapi [as 别名]
# 或者: from drf_yasg.openapi import TYPE_STRING [as 别名]
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