File tree 2 files changed +7
-5
lines changed
end_to_end_tests/golden-record/my_test_api_client/models
openapi_python_client/parser/properties
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,14 @@ class ModelWithMergedProperties:
16
16
"""
17
17
Attributes:
18
18
simple_string (Union[Unset, str]): extended simpleString description Default: 'new default'.
19
- string_to_enum (Union[Unset, ModelWithMergedPropertiesStringToEnum]):
19
+ string_to_enum (Union[Unset, ModelWithMergedPropertiesStringToEnum]): Default: 'a'.
20
20
string_to_date (Union[Unset, datetime.date]):
21
21
number_to_int (Union[Unset, int]):
22
22
any_to_string (Union[Unset, str]): Default: 'x'.
23
23
"""
24
24
25
25
simple_string : Union [Unset , str ] = "new default"
26
- string_to_enum : Union [Unset , ModelWithMergedPropertiesStringToEnum ] = UNSET
26
+ string_to_enum : Union [Unset , ModelWithMergedPropertiesStringToEnum ] = "a"
27
27
string_to_date : Union [Unset , datetime .date ] = UNSET
28
28
number_to_int : Union [Unset , int ] = UNSET
29
29
any_to_string : Union [Unset , str ] = "x"
Original file line number Diff line number Diff line change @@ -275,7 +275,9 @@ def _add_if_no_conflict(new_prop: Property) -> PropertyError | None:
275
275
properties [merged_prop .name ] = merged_prop
276
276
return None
277
277
278
- unprocessed_props = data .properties or {}
278
+ unprocessed_props : list [tuple [str , oai .Reference | oai .Schema ]] = (
279
+ list (data .properties .items ()) if data .properties else []
280
+ )
279
281
for sub_prop in data .allOf :
280
282
if isinstance (sub_prop , oai .Reference ):
281
283
ref_path = parse_reference_path (sub_prop .ref )
@@ -297,10 +299,10 @@ def _add_if_no_conflict(new_prop: Property) -> PropertyError | None:
297
299
return err
298
300
schemas .add_dependencies (ref_path = ref_path , roots = roots )
299
301
else :
300
- unprocessed_props .update (sub_prop .properties or {} )
302
+ unprocessed_props .extend (sub_prop .properties . items () if sub_prop . properties else [] )
301
303
required_set .update (sub_prop .required or [])
302
304
303
- for key , value in unprocessed_props . items () :
305
+ for key , value in unprocessed_props :
304
306
prop_required = key in required_set
305
307
prop_or_error : Property | (PropertyError | None )
306
308
prop_or_error , schemas = property_from_data (
You can’t perform that action at this time.
0 commit comments