Skip to content

Commit b111ab8

Browse files
[Python] Bugfix in model.mustache (#12630)
Before bugfix: a required and nullable attribute set to null/None causes a value error when received by the client. After bugfix: This error is only caused for properties being required and not nullable General info: The python client cannot distinguish between unset attributes (value=None) and attributes set to null (value=None) Authored-by: MalteEbner <[email protected]>
1 parent 596bd1a commit b111ab8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/swagger-codegen/src/main/resources/python/model.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ class {{classname}}(object):
9999
:type: {{datatype}}
100100
"""
101101
{{#required}}
102+
{{^nullable}}
102103
if self._configuration.client_side_validation and {{name}} is None:
103104
raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501
105+
{{/nullable}}
104106
{{/required}}
105107
{{#isEnum}}
106108
{{#isContainer}}

0 commit comments

Comments
 (0)