exclude endpoint from drf_yasg example
To exclude an endpoint from drf_yasg documentation, you can use the @swagger_auto_schema decorator with the exclude parameter. For example:
from drf_yasg.utils import swagger_auto_schema
@swagger_auto_schema(exclude=True)
@api_view(['GET'])
def excluded_endpoint(request):
# Your code here
This will exclude the excluded_endpoint from the generated documentation.
原文地址: https://www.cveoy.top/t/topic/btK1 著作权归作者所有。请勿转载和采集!