{%- macro get_type_annotation(_field) -%}
{%- if _field.annotated -%}
{{ _field.annotated }}
{%- elif _field.field -%}
Annotated[{{ _field.type_hint }}, {{ _field.field }}]
{%- else -%}
{{ _field.type_hint }}
{%- endif -%}
{%- endmacro -%}

{%- if fields %}
{{ class_name }}: TypeAlias = {{ get_type_annotation(fields[0]) }}{% if comment is defined %}  # {{ comment }}{% endif %}
{%- if description %}
{{ description }}
{%- elif fields[0].docstring %}
{{ fields[0].docstring }}
{%- endif %}
{%- else %}
{{ class_name }}: TypeAlias = {{ base_class }}{% if comment is defined %}  # {{ comment }}{% endif %}
{%- if description %}
{{ description }}
{%- endif %}
{%- endif %}
