Skip to content

Commit 81ebc0d

Browse files
Allow missing descriptions. (#2894)
1 parent d02e28e commit 81ebc0d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.generator/src/generator/templates/model_generic.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ class {{ name }}(ModelNormal):
122122
{%- if attr not in model.get("required", []) %} {{ attr|attribute_name }}: {{ get_typing_for_attribute(model, attr, current_name=name, optional=True) }}=unset,{% endif %}
123123
{%- endfor %} **kwargs):
124124
"""
125+
{%- if "description" in model %}
125126
{{ model.description|docstring|indent(8) }}
127+
{%- endif %}
126128
{%- for attr, definition in model.get("properties", {}).items() %}
127129
{# keep new line #}
128130
:param {{ attr|attribute_name }}: {{ definition.description|docstring|indent(12) }}{% if definition.deprecated %} **Deprecated**.{% endif %}

0 commit comments

Comments
 (0)