django-rest-swagger 2.2.0 endpoints with auth classes not visible

493 Views Asked by At

I'm developing a django application that has a bunch of endpoints that have custom and basic auth classes defined, but swagger shows only endpoints that don't have authentication classes and have a permission class = AllowAny.

How to make all endpoints be visible at 'docs/' endpoint without any authentications/permissions?

Django==2.1.7 djangorestframework==3.9.1 jango-rest-swagger==2.2.0

REST_FRAMEWORK = { 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.AllowAny', ), 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.SessionAuthentication', ), 'DEFAULT_PARSER_CLASSES': ( 'rest_framework.parsers.JSONParser', 'rest_framework.parsers.FormParser', 'rest_framework.parsers.MultiPartParser', ) }

SWAGGER_SETTINGS = { 'exclude_namespaces': [], # List URL namespaces to ignore 'api_version': '', # Specify your API's version. Might be useful in future 'api_path': '/', # Specify the path to your API not a root level 'enabled_methods': [ # Specify which methods to enable in Swagger UI 'get', 'post', 'put', 'patch', 'delete' ], 'token_type': 'Bearer', 'api_key': {}, # An API key 'is_authenticated': False, # Set to True to enforce user authentication, 'is_superuser': False, # Set to True to enforce admin only access }

0

There are 0 best solutions below