Retain ordering of paths as provided in urlconf in OpenAPI schemas.

This commit is contained in:
Alan Crosswell 2019-05-16 11:52:00 -05:00 committed by Carlton Gibson
parent c975a1b554
commit 7d7912b769
2 changed files with 3 additions and 1 deletions

View File

@ -44,6 +44,7 @@ You can determine your currently installed version using `pip show`:
**Date**: [Unreleased][3.10.0-milestone] **Date**: [Unreleased][3.10.0-milestone]
* Updated PyYaml dependency for OpenAPI schema generation to `pyyaml>=5.1` [#6680][gh6680]
* Resolve DeprecationWarning with markdown. [#6317][gh6317] * Resolve DeprecationWarning with markdown. [#6317][gh6317]
@ -2137,4 +2138,5 @@ For older release notes, [please see the version 2.x documentation][old-release-
[gh6613]: https://github.com/encode/django-rest-framework/issues/6613 [gh6613]: https://github.com/encode/django-rest-framework/issues/6613
<!-- 3.10.0 --> <!-- 3.10.0 -->
[gh6680]: https://github.com/encode/django-rest-framework/issues/6680
[gh6317]: https://github.com/encode/django-rest-framework/issues/6317 [gh6317]: https://github.com/encode/django-rest-framework/issues/6317

View File

@ -54,7 +54,7 @@ def endpoint_ordering(endpoint):
'PATCH': 3, 'PATCH': 3,
'DELETE': 4 'DELETE': 4
}.get(method, 5) }.get(method, 5)
return (path, method_priority) return (method_priority,)
_PATH_PARAMETER_COMPONENT_RE = re.compile( _PATH_PARAMETER_COMPONENT_RE = re.compile(