File tree 1 file changed +4
-1
lines changed
openapi_python_client/templates/property_templates
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,13 @@ elif {{ source }} is None:
66
66
{% else %}
67
67
{% set ns .contains_modified_properties = true %}
68
68
{% endif %}
69
+ {% set has_first_clause = false %}
69
70
{% if loop .first and property .required and not property .nullable %} {# No if UNSET or if None statement before this #}
71
+ {% set has_first_clause = true %}
70
72
if isinstance({{ source }}, {{ inner_property.get_instance_type_string() }}):
71
73
{% elif not loop .last or ns .contains_properties_without_transform %}
72
- elif isinstance({{ source }}, {{ inner_property.get_instance_type_string() }}):
74
+ {% if not has_first_clause %} if{% else %} elif{% endif %} isinstance({{ source }}, {{ inner_property.get_instance_type_string() }}):
75
+ {% set has_first_clause = true %}
73
76
{% else %}
74
77
else:
75
78
{% endif %}
You can’t perform that action at this time.
0 commit comments