-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate a schema_views per version #126
Comments
Which kind of versions are you referring to? If you are talking about Django Rest Framework versioning, in theory the schema_view will adapt itself based on the API version you are accesing it with. e.g. with url(r'^(?P<version>v1|v2)/swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=None), name='schema-json'), , Please clarify if I'm not correctly understanding your issue. |
This is exactly what I want! |
hey @axnsan12 I am trying to also do this, however we use custom versioning implementation (not I have tried advice above, but it generates same schema for both versions that we have in our app. By the looks of it, we need to implement some of the attributes that |
I tried implementing different schemas for different versions. However, I was unsuccessful. After investigating drf_yasg code for a couple of hours, it looks like this particular snippet is the problem. drf-yasg/src/drf_yasg/generators.py Lines 52 to 54 in ab6444a
the |
Is there a way to limit a schema_view to a version ? In order to generate a v1.json and a v2.json.
Using patterns in get_schema_view() seems really complicated for this use case.
If there is currently no way to do that, I'm able to spent some time in the implementation :D
The text was updated successfully, but these errors were encountered: