diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/an_all_of_enum.py b/end_to_end_tests/golden-record/my_test_api_client/models/an_all_of_enum.py index bda0a53cd..3aef48f8f 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/an_all_of_enum.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/an_all_of_enum.py @@ -2,9 +2,9 @@ class AnAllOfEnum(str, Enum): - FOO = "foo" - BAR = "bar" A_DEFAULT = "a_default" + BAR = "bar" + FOO = "foo" OVERRIDDEN_DEFAULT = "overridden_default" def __str__(self) -> str: diff --git a/end_to_end_tests/golden-record/my_test_api_client/models/get_location_header_types_string_enum_header.py b/end_to_end_tests/golden-record/my_test_api_client/models/get_location_header_types_string_enum_header.py index b5dbd4ff8..cce92dcde 100644 --- a/end_to_end_tests/golden-record/my_test_api_client/models/get_location_header_types_string_enum_header.py +++ b/end_to_end_tests/golden-record/my_test_api_client/models/get_location_header_types_string_enum_header.py @@ -3,8 +3,8 @@ class GetLocationHeaderTypesStringEnumHeader(str, Enum): ONE = "one" - TWO = "two" THREE = "three" + TWO = "two" def __str__(self) -> str: return str(self.value) diff --git a/openapi_python_client/templates/str_enum.py.jinja b/openapi_python_client/templates/str_enum.py.jinja index 4a9ab384a..e0da5ed0f 100644 --- a/openapi_python_client/templates/str_enum.py.jinja +++ b/openapi_python_client/templates/str_enum.py.jinja @@ -1,7 +1,7 @@ from enum import Enum class {{ enum.class_info.name }}(str, Enum): - {% for key, value in enum.values.items() %} + {% for key, value in enum.values|dictsort(true) %} {{ key }} = "{{ value }}" {% endfor %}