@swagger_auto_schema(method='GET', manual_parameters=[project_param])
@api_view(['GET'])
def get_project_info(request):
"""
获取项目信息
"""
版本信息:
Django == 2.2.1
drf-yasg == 1.16.1
答案 0 :(得分:2)
答案 1 :(得分:0)
您可以使用swagger_auto_schema
装饰器来显示ID,摘要和说明。
from drf_yasg.utils import swagger_auto_schema
class ProductOperation(ModelViewSet):
@swagger_auto_schema(
operation_id='Display end of opblock',
operation_summary="Display outside",
operation_description='Display inside',
)
def action_one(self, request):
dosomething()