Enable API-versioning and allow for both v3 and v4 versions.#7802
Open
ggainey wants to merge 1 commit into
Open
Enable API-versioning and allow for both v3 and v4 versions.#7802ggainey wants to merge 1 commit into
ggainey wants to merge 1 commit into
Conversation
75e4f88 to
fcdcf5b
Compare
c88e6ee to
d38417a
Compare
This is a tech-preview PR, and will only "turn on" if the ENABLE_V4_API is set to True in settings. It will allow urls for /v3/ and /v4/, and reject other versions. For urlpatterns registered with a `/<str:version>/` slug, views will be called with a `version=` kwarg. NOTE: To play this game, plugins will need to insure that all views accept `**kwargs` first, and then update the patterns in their `urls.py` to include the version-slug. See the `/status/` view and serializer(s) for an example of how to respond based on the incoming request. NOTE to implementers: **existing tests must pass without changes** whether the ENABLE flag is True or False. If that isn't the case - you're doing something wrong. closes pulp#6462
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a tech-preview PR, and will only "turn on" if the ENABLE_V4_API is set to True in settings.
It will allow urls for /v3/ and /v4/, and reject other versions.
For urlpatterns registered with a
/<str:version>/slug, views will be called with aversion=kwarg.NOTE: To play this game, plugins will need to insure that all views accept
**kwargsfirst, and then update the patterns in theirurls.pyto include the version-slug.See the
/status/view and serializer(s) for an example of how to respond based on the incoming request.NOTE to implementers: existing tests must pass without changes whether the ENABLE flag is True or False. If that isn't the case - you're doing something wrong.
closes #6462