From c3db4bd3f9fb298a0291af804a284d192a94dbbd Mon Sep 17 00:00:00 2001 From: Bojan Jovanovic Date: Sun, 23 Mar 2025 13:21:56 +0100 Subject: [PATCH] fix: handle None case in union property template condition --- .../templates/property_templates/property_macros.py.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: