Skip to content

Commit 5b95eb4

Browse files
Fix bug
1 parent e90720f commit 5b95eb4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

openapi_python_client/parser/properties/model_property.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ def _is_int_enum(prop: Property) -> bool:
5858
return isinstance(prop, EnumProperty) and prop.value_type == int
5959

6060

61+
def values_are_subset(first: EnumProperty, second: EnumProperty) -> bool:
62+
return set(first.values.items()) <= set(second.values.items())
63+
64+
6165
def _is_subtype(first: Property, second: Property) -> bool:
6266
from . import IntProperty, StringProperty
6367

@@ -67,8 +71,8 @@ def _is_subtype(first: Property, second: Property) -> bool:
6771
_is_int_enum(first) and isinstance(second, IntProperty),
6872
_is_string_enum(first)
6973
and _is_string_enum(second)
70-
and set(first.values.items()) <= set(second.values.items()),
71-
_is_int_enum(first) and _is_int_enum(second) and set(first.values.items()) <= set(second.values.items()),
74+
and values_are_subset(first, second),
75+
_is_int_enum(first) and _is_int_enum(second) and values_are_subset(first, second),
7276
]
7377
)
7478

0 commit comments

Comments
 (0)