diff --git a/KotlinServer/Class.kt.twig b/KotlinServer/Class.kt.twig index 5529222..91fb8ff 100644 --- a/KotlinServer/Class.kt.twig +++ b/KotlinServer/Class.kt.twig @@ -16,6 +16,5 @@ import java.time.ZonedDateTime */ {%- endif %} open class {% include 'blocks/class/classtype.twig' with { type: type } %} ( - {%- include 'blocks/class/constructor-fields-info.twig' with { fields: superclassesFields, includeVal: false, addCommaAtTheEnd: (fields is not empty) } %} - {%- include 'blocks/class/constructor-fields-info.twig' with { fields: fields, includeVal: true, addComma: false } %} + {%- include 'blocks/class/constructor-fields-info.twig' with { fields: allFieldsOrdered, superclassesFields: superclassesFields } %} ){% include 'blocks/class/supertype.twig' with { type: type, parent: parent } %} {%- include 'blocks/class/fields-super-initialization.twig' with { fields: superclassesFields } -%} \ No newline at end of file diff --git a/KotlinServer/blocks/class/constructor-fields-info.twig b/KotlinServer/blocks/class/constructor-fields-info.twig index ee6ce76..b241fa6 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 %} {{ utils.addDescription(field) }} + {% if not (field in superclassesFields) %}val {% endif %}{{ field.name }}: {{ utils.formatValueType(field.type.type, field.nullable, field.optional) }}{{ utils.writeNullCheckMark(field.nullable, field.optional) }} {%- if not (loop.last) %}, {% endif %} {{ utils.addDescription(field) }} {%- endfor -%} \ No newline at end of file