From 87187b19af5d713152e743f14117a16e6ed8db26 Mon Sep 17 00:00:00 2001 From: "Terence D. Honles" Date: Thu, 2 Mar 2023 17:19:03 +0100 Subject: [PATCH] keep path parameters in their given order --- src/drf_yasg/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drf_yasg/generators.py b/src/drf_yasg/generators.py index 66c8e97c..bca071c4 100644 --- a/src/drf_yasg/generators.py +++ b/src/drf_yasg/generators.py @@ -495,7 +495,7 @@ def get_path_parameters(self, path, view_cls): parameters = [] queryset = get_queryset_from_view(view_cls) - for variable in sorted(uritemplate.variables(path)): + for variable in uritemplate.variables(path): model, model_field = get_queryset_field(queryset, variable) attrs = get_basic_type_info(model_field) or {'type': openapi.TYPE_STRING} if getattr(view_cls, 'lookup_field', None) == variable and attrs['type'] == openapi.TYPE_STRING: