From 8d900f14f4848e19e94cc047628e3c2928778416 Mon Sep 17 00:00:00 2001 From: ajaaym <34161822+ajaaym@users.noreply.github.com> Date: Mon, 19 Nov 2018 14:01:33 -0500 Subject: [PATCH] feat: Add support for repeated fields (#1451) --- src/generator/templates/api-endpoint.njk | 4 ++-- src/generator/templates/resource-partial.njk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generator/templates/api-endpoint.njk b/src/generator/templates/api-endpoint.njk index 19d7ea0d0c1..27669ae7845 100644 --- a/src/generator/templates/api-endpoint.njk +++ b/src/generator/templates/api-endpoint.njk @@ -45,7 +45,7 @@ interface StandardParameters { /** * {{ p.description|oneLine|cleanComments|safe }} */ - {{ pname|cleanPropertyName|safe }}?: {{ p.type }}; + {{ pname|cleanPropertyName|safe }}?: {{ p.type }}{% if p.repeated %}[]{% endif %}; {% endfor %} } @@ -142,7 +142,7 @@ export interface Schema${{ schema.id }} { /** * {{ p.description|oneLine|cleanComments|safe }} */ - {{ pname|getSafeParamName }}?: {{ p.type }}; + {{ pname|getSafeParamName }}?: {{ p.type }}{% if p.repeated %}[]{% endif %}; {% endfor %} {% endif %} diff --git a/src/generator/templates/resource-partial.njk b/src/generator/templates/resource-partial.njk index 0bb385eb36d..11f4345454b 100644 --- a/src/generator/templates/resource-partial.njk +++ b/src/generator/templates/resource-partial.njk @@ -47,7 +47,7 @@ /** * {{ p.description|oneLine|cleanComments|safe }} */ - {{ pname|cleanPropertyName|safe }}?: {{ p|getType }}; + {{ pname|cleanPropertyName|safe }}?: {{ p|getType }}{% if p.repeated %}[]{% endif %}; {% endfor %} {% endif %}