To hide the endpoint in the Django documentation just @schema(None)
has to be added for example to GenericAPIView, however I have a problem with these three urls:
url(r'^swagger/', schema_view),
url(r'^rest-auth/', include('rest_auth.urls')),
url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
I am not able to add @schema(None)
decorator because I do not have declared views for these urls. Any ideas how to work it around?
Yes, you can just call the
schema(None)(…)
function, this is in essence what a decorator does:装饰器基本上将函数,类等传递给函数,然后将结果分配给您最初使用的标识符。