Skip to content

Commit 1c7ddbb

Browse files
committed
Fix bug in model property template that was not handling unset properly
1 parent 2dcd07e commit 1c7ddbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openapi_python_client/templates/property_templates/model_property.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
{% elif property.nullable %}
88
{{ property.python_name }} = None
99
{% else %}
10-
{{ property.python_name }} = UNSET
10+
{{ property.python_name }}: {{ property.get_type_string() }} = UNSET
1111
{% endif %}
1212
_{{ property.python_name }} = {{source}}
13-
if _{{ property.python_name }} is not None and not isinstance({{ property.python_name }}, Unset):
13+
if _{{ property.python_name }} is not None and not isinstance(_{{ property.python_name }}, Unset):
1414
{{ property.python_name }} = {{ property.reference.class_name }}.from_dict(cast(Dict[str, Any], _{{ property.python_name }}))
1515
{% endif %}
1616
{% endmacro %}

0 commit comments

Comments
 (0)