From 5cbbcce2f60e7b41e07dc224822f3e750b3749f7 Mon Sep 17 00:00:00 2001 From: Elena Bobkova Date: Fri, 23 Nov 2018 14:49:42 +0300 Subject: [PATCH] description added --- KotlinServer/blocks/class/constructor-fields-info.twig | 2 +- KotlinServer/utils.twig | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/KotlinServer/blocks/class/constructor-fields-info.twig b/KotlinServer/blocks/class/constructor-fields-info.twig index bbfb55c..ee6ce76 100644 --- a/KotlinServer/blocks/class/constructor-fields-info.twig +++ b/KotlinServer/blocks/class/constructor-fields-info.twig @@ -9,5 +9,5 @@ {%- elseif field.optional %} @JsonInclude(JsonInclude.Include.NON_NULL) {%- endif %} - {% if includeVal %}val {% endif %}{{ field.name }}: {{ utils.formatValueType(field.type.type, field.nullable, field.optional) }}{{ utils.writeNullCheckMark(field.nullable, field.optional) }} {%- if (not (loop.last)) or (addCommaAtTheEnd)%}, {% endif %} + {% if includeVal %}val {% endif %}{{ field.name }}: {{ utils.formatValueType(field.type.type, field.nullable, field.optional) }}{{ utils.writeNullCheckMark(field.nullable, field.optional) }} {%- if (not (loop.last)) or (addCommaAtTheEnd)%}, {% endif %} {{ utils.addDescription(field) }} {%- endfor -%} \ No newline at end of file diff --git a/KotlinServer/utils.twig b/KotlinServer/utils.twig index e283d99..d7e7d93 100644 --- a/KotlinServer/utils.twig +++ b/KotlinServer/utils.twig @@ -31,4 +31,10 @@ List<{{ self.formatValueType(valueType.itemsType, true, true) }}> {% macro formatEnumValue(valuesTypes, value) %} {%- if valuesTypes == "STRING" -%}"{{ value.value }}"{%- elseif valuesTypes == "INT" -%}{{ value.value }}{%- endif -%} -{% endmacro %} \ No newline at end of file +{% endmacro %} + +{% macro addDescription(field) %} +{%- if (field.description is not empty) -%} +// {{ field.description }} +{%- endif -%} +{% endmacro %}