api-generator-templates/Swift/blocks/class/fields-without-initializati...

11 lines
431 B
Twig

{%- import '../../macroses/common.utils.twig' as utils -%}
{%- if fields is not empty -%}
{%- for field in fields -%}
{%- if field.nullable or field.optional -%}
{{ field.name }}: {{ field.name }} ? nil : self.{{ field.name }}{%- if not (loop.last) %}, {% endif %}
{%- else -%}
{{ field.name }}: self.{{ field.name }}{%- if not (loop.last) %}, {% endif %}
{%- endif -%}
{%- endfor -%}
{%- endif -%}