Skip to content

Commit 95d64fe

Browse files
MalteEbnerdaniel-kmiecik
authored andcommitted
[Python] Bugfix in model.mustache
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)
1 parent 0c712a5 commit 95d64fe

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)