Skip to content
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

3.15 regression: Unset default namespace version suddenly raises 404 #9334

Closed
peterthomassen opened this issue Mar 22, 2024 · 3 comments · Fixed by #9335
Closed

3.15 regression: Unset default namespace version suddenly raises 404 #9334

peterthomassen opened this issue Mar 22, 2024 · 3 comments · Fixed by #9335

Comments

@peterthomassen
Copy link
Contributor

This is a regression that significantly changes the API. The change should be reverted.

@peterthomassen peterthomassen mentioned this issue Mar 22, 2024
9 tasks
@auvipy
Copy link
Member

auvipy commented Mar 22, 2024

#9335

@Kostia-K
Copy link
Contributor

It's possible I interpreted the documentation wrong, but here it says

ALLOWED_VERSIONS. If set, this value will restrict the set of versions that may be returned by the versioning scheme, and will raise an error if the provided version is not in this set. Note that the value used for the DEFAULT_VERSION setting is always considered to be part of the ALLOWED_VERSIONS set (unless it is None). Defaults to None.

The "unless it is None" part refers to DEFAULT_VERSION. Doesn't make sense for it to refer to ALLOWED_VERSIONS because if it's None, anything is allowed.

This is also consistent with how other versioning schemes behave, see TestAcceptHeaderAllowedAndDefaultVersion.test_missing_without_default and TestAcceptHeaderAllowedAndDefaultVersion.test_missing_without_default_but_none_allowed. I added equivalent tests in TestNamespaceAllowedAndDefaultVersion.

To fix the problem, you have to add None to ALLOWED_VERSIONS as shown in the unit tests.

I could be wrong but please review this again. You might be relying on incorrect, undocumented behavior. The API changes only make the behavior consistent with the documentation and with other versioning schemes.

@peterthomassen
Copy link
Contributor Author

Fair enough, it's actually not a big deal to make that change. The issue is more about the unexpected breakage, instead of going through the usual deprecation stages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants