You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
here is a quick workaround that is working for me:
add a url like url(r'^schema(?P<version>[0-9.]*)/', MySchemaViewWOV.as_view(), name='api_schema')
and a view like
from rest_framework import permissions
from drf_openapi.views import SchemaView
class MySchemaViewWOV(SchemaView):
permission_classes = (permissions.AllowAny,)
def get(self, request, version=None):
return super(MySchemaViewWOV, self).get(request, '1.0')
Of course, set your permissions to fit your needs.
This will allow usages like http://localhost:8000/schema/ but also http://localhost:8000/schema1.4/ etc.
But the view will always return the 1.0 version. The version URL parameter is necessary for reverse urls in the drf_openapi templates.
I know versioning your APIs is a good practice, but is there a way to use this library without putting a version in the URL, just like this:
The text was updated successfully, but these errors were encountered: