Skip to content

Commit 46b56d0

Browse files
committed
modules
1 parent 59042aa commit 46b56d0

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

modules/openapi-generator/src/main/resources/python-fastapi/model_generic.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
8181
{{/vars}}
8282

8383
model_config = {
84-
"populate_by_name": True,
84+
"validate_by_name": True,
85+
"validate_by_alias": True,
8586
"validate_assignment": True,
8687
"protected_namespaces": (),
8788
}

modules/openapi-generator/src/main/resources/python/model_generic.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
9494
{{/vars}}
9595

9696
model_config = ConfigDict(
97-
populate_by_name=True,
97+
validate_by_name=True,
98+
validate_by_alias=True,
9899
validate_assignment=True,
99100
protected_namespaces=(),
100101
)

0 commit comments

Comments
 (0)