Fix NamespaceVersioning ignoring DEFAULT_VERSION on non-None namespaces#7278
Merged
auvipy merged 1 commit intoencode:masterfrom Jun 14, 2023
Merged
Fix NamespaceVersioning ignoring DEFAULT_VERSION on non-None namespaces#7278auvipy merged 1 commit intoencode:masterfrom
auvipy merged 1 commit intoencode:masterfrom
Conversation
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Collaborator
|
If this is just going to fix bug without breaking any expected behavior then we might consider this |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closed
8ab39ec to
6fabaa3
Compare
* Fix the case where if the namespace is not None and there's no match, NamespaceVersioning always raises NotFound even if DEFAULT_VERSION is set or None is in ALLOWED_VERSIONS * Add test cases
6fabaa3 to
7050b4d
Compare
Collaborator
|
the patch looks good to me. I will take the time to review it thoroughly. I would really appreciate if you can do a pull review of this PR #8923 |
auvipy
approved these changes
Jun 14, 2023
auvipy
added a commit
that referenced
this pull request
Jun 17, 2023
* fix OpenAPIRenderer for timedelta * added test for rendering openapi with timedelta * fix OpenAPIRenderer for timedelta * added test for rendering openapi with timedelta * Removed usage of field.choices that triggered full table load (#8950) Removed the `{{ field.choices|yesno:",disabled" }}` block because this triggers the loading of full database table worth of objects just to determine whether the multi-select widget should be set as disabled or not. Since this "disabled" marking feature is not present in the normal select field, then I propose to remove it also from the multi-select. * Added Deprecation Warnings for CoreAPI (#7519) * Added Deprecation Warnings for CoreAPI * Bumped removal to DRF315 * Update rest_framework/__init__.py * Update rest_framework/filters.py * Update rest_framework/filters.py * Update tests/schemas/test_coreapi.py * Update rest_framework/filters.py * Update rest_framework/filters.py * Update tests/schemas/test_coreapi.py * Update tests/schemas/test_coreapi.py * Update setup.cfg * Update rest_framework/pagination.py --------- Co-authored-by: Asif Saif Uddin <[email protected]> * Update copy right timeline * Fix NamespaceVersioning ignoring DEFAULT_VERSION on non-None namespaces (#7278) * Fix the case where if the namespace is not None and there's no match, NamespaceVersioning always raises NotFound even if DEFAULT_VERSION is set or None is in ALLOWED_VERSIONS * Add test cases * fix OpenAPIRenderer for timedelta * added test for rendering openapi with timedelta * added testcase for rendering yaml with minvalidator for duration field (timedelta) --------- Co-authored-by: Rizwan Shaikh <[email protected]> Co-authored-by: Lenno Nagel <[email protected]> Co-authored-by: David Smith <[email protected]> Co-authored-by: Asif Saif Uddin <[email protected]> Co-authored-by: Konstantin Kuchkov <[email protected]>
Collaborator
|
we got a regression/breaking change report |
Contributor
Author
Thanks for letting me know. Responded in the issue comments. |
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.
Fix the case where if the namespace is not None and there's no match,
NamespaceVersioning always raises NotFound even if DEFAULT_VERSION
is set or None is in ALLOWED_VERSIONS
Add test cases
Description
If my namespace is just
'api'(i.e. doesn't include version info),ALLOWED_VERSIONSis set to['v1', 'v2']andDEFAULT_VERSIONis set to'v2', I would expectrequest.versionto resolve to'v2'. The current behavior in this scenario is404 Not Foundwhich is inconsistent with the documentation.Similarly, if
DEFAULT_VERSIONis not set andALLOWED_VERSIONSincludesNone, I would expectrequest.versionto beNone. The current behavior is, once again, 404.