File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
openapi_python_client/parser/properties Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ def _is_int_enum(prop: Property) -> bool:
58
58
return isinstance (prop , EnumProperty ) and prop .value_type == int
59
59
60
60
61
+ def values_are_subset (first : EnumProperty , second : EnumProperty ) -> bool :
62
+ return set (first .values .items ()) <= set (second .values .items ())
63
+
64
+
61
65
def _is_subtype (first : Property , second : Property ) -> bool :
62
66
from . import IntProperty , StringProperty
63
67
@@ -67,8 +71,8 @@ def _is_subtype(first: Property, second: Property) -> bool:
67
71
_is_int_enum (first ) and isinstance (second , IntProperty ),
68
72
_is_string_enum (first )
69
73
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 ),
72
76
]
73
77
)
74
78
You can’t perform that action at this time.
0 commit comments