我正在使用带有swagger ui的drf_yasg来记录我们的Django应用,试图排除post方法不起作用,也没有操作说明
@method_decorator(name='create', decorator=swagger_auto_schema(auto_schema=None))
@method_decorator(name='list', decorator=swagger_auto_schema(operation_description="GET /dashboards"))
class DashboardAPIView(ListCreateAPIView):
"""
View class that extends the Django rest framework generic view ListCreateAPIView
to perform GET and POST operations for Dashboards
"""
queryset = Dashboards.objects.all().order_by('dash_name')
serializer_class = DashboardSerializer
def perform_create(self, serializer):
sequence_no = get_next_sequence_number_test_dashboard()
serializer.save(sequence_no=sequence_no)
期望的职位被排除在外,并显示隐藏标题,但没有
dashboards
GET
/dashboards
dashboards_list
POST
/dashboards
dashboards_create