I am a little confused how to develop the documentation using the drf-yasg library. So I would like to ask exactly:
How can I use a static swagger.json
file created by swagger editor online with drf-yasg ? (There are endpoints in my project that don't have serializers and models, so i created the schema manually!)
My project use a permissions control with custom management. Is there any way to manage the endpoints urls in the schema if the user is not allowed permission to view specific endpoint?
drf-yasg
creates the swagger.json file by crawling your django-rest-framework
application. You cannot use it to merge an existing swagger.json
file.
You can specify permissions using permission_classes=(permissions.AllowAny,),
. See related .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.