From b9ef35a772b40e3a46f996761ea3fe2ae6ed0382 Mon Sep 17 00:00:00 2001 From: Elena Bobkova Date: Wed, 26 Jun 2019 16:34:41 +0300 Subject: [PATCH 1/2] kotlin server templates fixed --- KotlinServer/utils.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KotlinServer/utils.twig b/KotlinServer/utils.twig index 1be181b..7fc978b 100644 --- a/KotlinServer/utils.twig +++ b/KotlinServer/utils.twig @@ -21,7 +21,7 @@ Map<{{ self.formatValueType(valueType.keysType, true, true) }}, {{ self.formatVa {%- elseif valueType.baseTypeName == "Array" -%} List<{{ self.formatValueType(valueType.itemsType, true, true) }}> {%- else -%} -{{ valueType.baseTypeName }} +{% include 'blocks/class/classtype.twig' with { type: valueType } %} {%- endif -%} {% endmacro %} From f3283e3fcc41aa132e1e14cdce0eeb3f4b63ebdd Mon Sep 17 00:00:00 2001 From: Elena Bobkova Date: Wed, 26 Jun 2019 17:10:38 +0300 Subject: [PATCH 2/2] web documentation fixed --- Web-documentation/blocks/classtype.twig | 1 + Web-documentation/blocks/field-row.html.twig | 4 ++-- Web-documentation/blocks/type-parameters.twig | 8 ++++++++ Web-documentation/utils.twig | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 Web-documentation/blocks/classtype.twig create mode 100644 Web-documentation/blocks/type-parameters.twig diff --git a/Web-documentation/blocks/classtype.twig b/Web-documentation/blocks/classtype.twig new file mode 100644 index 0000000..623f00f --- /dev/null +++ b/Web-documentation/blocks/classtype.twig @@ -0,0 +1 @@ +{{- type.baseTypeName -}}{%- include 'type-parameters.twig' with { typeParameters: type.typeParameters } -%} \ No newline at end of file diff --git a/Web-documentation/blocks/field-row.html.twig b/Web-documentation/blocks/field-row.html.twig index 99f8510..8e42d83 100644 --- a/Web-documentation/blocks/field-row.html.twig +++ b/Web-documentation/blocks/field-row.html.twig @@ -28,9 +28,9 @@ {%- if link is not null -%} - {{- utils.formatNullable(valueType.typeName, nullable) -}} + {{- utils.formatNullableClassType(valueType, nullable) -}} {%- else -%} - {{- utils.formatNullable(valueType.typeName, nullable) -}} + {{- utils.formatNullableClassType(valueType, nullable) -}} {%- endif -%} {%- endif -%} {%- endmacro -%} diff --git a/Web-documentation/blocks/type-parameters.twig b/Web-documentation/blocks/type-parameters.twig new file mode 100644 index 0000000..9656547 --- /dev/null +++ b/Web-documentation/blocks/type-parameters.twig @@ -0,0 +1,8 @@ +{%- import '../utils.twig' as utils -%} +{%- if typeParameters is not empty -%} +< +{%- for typeParameter in typeParameters %} +{{- typeParameter.baseTypeName -}}{%- if not (loop.last) %}, {% endif %} +{%- endfor -%} +> +{%- endif -%} diff --git a/Web-documentation/utils.twig b/Web-documentation/utils.twig index 6ee0674..f92f125 100644 --- a/Web-documentation/utils.twig +++ b/Web-documentation/utils.twig @@ -2,6 +2,10 @@ {{- expr -}}{%- if nullable -%}?{%- endif -%} {% endmacro %} +{% macro formatNullableClassType(valueType, nullable) %} +{% include 'blocks/classtype.twig' with { type: valueType } %}{%- if nullable -%}?{%- endif -%} +{% endmacro %} + {% macro optionalDescription(optional) %} {%- if optional -%}Нет{%- else -%}Да{%- endif -%} {% endmacro %}