Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

improve versioning schemes support #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trik
Copy link

@trik trik commented Feb 2, 2018

close #98

view_config decorator now gets version using determine_version method of ApiView (vs version keyword argument which is not set eg. with AcceptHeaderVersioning)

close #71

with this schemes support improvement, drf_openapi's urls can be imported without a version parameter in url if REST_FRAMEWORK['DEFAULT_VERSION'] is set

@trik trik force-pushed the improve-versioning branch from cd28c39 to 1494fcf Compare February 6, 2018 09:12
@ju5t
Copy link

ju5t commented Feb 10, 2018

@trik I've just tested this but it seems you still need to specify the version as url(r'^(?P<version>(v1))/', include('drf_openapi.urls')),. This is required by <redoc spec-url='{% url 'api_schema' version=request.version %}?format=openapi'></redoc>.

I haven't tried #93 yet but that seems to cover it.

@trik
Copy link
Author

trik commented Feb 12, 2018

@ju5t how did you test it? which versioning scheme did you use for testing?

when using AcceptHeaderVersioning scheme, you have to set version in Accept http header to get a specific version

schermata 2018-02-12 alle 11 03 23

if you mean that you can't render api docs using the default drf_openapi template, yeah it's true, but #93 doesn't seem a good solution for AcceptHeaderVersioning anyway, because i'm still forced to define a version keyword argument which is quite non-sense for this scheme
maybe we could add a version or force_version GET parameter

@ju5t
Copy link

ju5t commented Feb 12, 2018

@trik AcceptHeaderVersioning. We have DEFAULT_VERSION set too. If we don't specify a header it should still be able to render the docs, I think?

@trik
Copy link
Author

trik commented Feb 13, 2018

@ju5t not with the current template, unless you specify a version keyword argument in url

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support other versioning schemes API urls without versions
2 participants