Skip to content

Commit bb5c48a

Browse files
committed
fixes model_oneof
1 parent db32adf commit bb5c48a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

templates/python/model_oneof.mustache

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
8383
{{/isPrimitiveType}}
8484
{{/isContainer}}
8585
{{/composedSchemas.oneOf}}
86-
if match > 1:
87-
# more than 1 match
88-
raise ValueError("Multiple matches found when setting `actual_instance` in {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages))
89-
elif match == 0:
86+
if match == 0:
9087
# no match
9188
raise ValueError("No match found when setting `actual_instance` in {{{classname}}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. Details: " + ", ".join(error_messages))
9289
else:

0 commit comments

Comments
 (0)