drf_openapi
drf_openapi copied to clipboard
improve versioning schemes support
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 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.
@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
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
@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?
@ju5t not with the current template, unless you specify a version keyword argument in url