File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,9 @@ def flatten_union(tpe: RiverType) -> list[RiverType]:
270270 for oneof_t in one_of_candidate_types :
271271 discriminator_value = [
272272 _NON_ALNUM_RE .sub ("" , str (prop .const ))
273- for name , prop in oneof_t .properties .items ()
273+ for name , prop in sorted (
274+ list (oneof_t .properties .items ()), key = lambda kv : kv [0 ]
275+ )
274276 if isinstance (prop , RiverConcreteType )
275277 and name == discriminator_name
276278 and prop .const is not None
@@ -533,7 +535,10 @@ def extract_props(tpe: RiverType) -> list[dict[str, RiverType]]:
533535 if type .properties :
534536 needs_binding = True
535537 typeddict_encoder .append ("{" )
536- for name , prop in type .properties .items ():
538+ for (
539+ name ,
540+ prop ,
541+ ) in sorted (list (type .properties .items ()), key = lambda xs : xs [0 ]):
537542 typeddict_encoder .append (f"'{ name } ':" )
538543 type_name , _ , contents , _ = encode_type (
539544 prop , TypeName (prefix + name .title ()), base_model , in_module
You can’t perform that action at this time.
0 commit comments