我根据文档进行了覆盖,但仍然无法正常工作。
这些是文档: https://github.com/m-haziq/django-rest-swagger-docs#advance-usage https://github.com/marcgibbons/django-rest-swagger/issues/549
这是我的views.py
class JobIndustryOfJobViewSet(ModelViewSet):
"""
description: A viewset for viewing and editing industries of a job.
parameters:
- name: job_pk
type: string
required: true
location: path
"""
serializer_class = JobIndustryOfJobSerializer
def get_queryset(self):
"""
Filter by current user's client and parent object
"""
job = get_object_or_404(
get_job_queryset(self.request.user), pk=self.kwargs.get("job_pk")
)
return JobIndustry.objects.filter(job=job).select_related("industry")
它仍然没有在Swagger用户界面中显示参数说明
Django == 2.2.1
djangorestframework == 3.9.4
django-rest-swagger == 2.2.0