Open mashahabi15 opened 1 year ago
Adding public=True
to swagger initiation will solve the problem. like below:
schema_view = get_schema_view(
openapi.Info(
title="Sample",
default_version='v1',
),
url="",
public=True,
)
Hello. I have set up drf-yasg on my drf project. I have an issue using login required APIs. I've wrote a custom permission class called MyCustomPerm which inherits from BasePermission and overrides has_permission method. This method reads authorization header and authenticates it against JWT and sets user phone_number on request, then returns True/False considering the fact that user is authenticated or not. The problem is that Swagger UI doesn't show the APIs that have this permission class:
(My views are class based) How can I do that? Thank you very much.