diff --git a/openapi_python_client/templates/property_templates/property_macros.py.jinja b/openapi_python_client/templates/property_templates/property_macros.py.jinja index 52e1d41bc..b000ba52f 100644 --- a/openapi_python_client/templates/property_templates/property_macros.py.jinja +++ b/openapi_python_client/templates/property_templates/property_macros.py.jinja @@ -5,7 +5,7 @@ _{{ property.python_name }} = {{ source }} {{ property.python_name }}: {{ property.get_type_string() }} {% if not property.required %} -if isinstance(_{{ property.python_name }}, Unset): +if isinstance(_{{ property.python_name }}, Unset) or _{{ property.python_name }} is None: {{ property.python_name }} = UNSET {% endif %} else: