From 2fbf0f33b3016422779990f81126ef129fed738f Mon Sep 17 00:00:00 2001 From: hello-brsd Date: Mon, 15 Jul 2019 07:59:01 +0200 Subject: [PATCH] [typescript-fetch] support additional properties (#3325) --- .../main/resources/typescript-fetch/modelGeneric.mustache | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache index 8711fc7e59a..af08282facb 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache @@ -31,6 +31,9 @@ export interface {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{ export function {{classname}}FromJSON(json: any): {{classname}} { {{#hasVars}} return { + {{#additionalPropertiesType}} + ...json, + {{/additionalPropertiesType}} {{#vars}} {{#isPrimitiveType}} {{#isDate}} @@ -77,6 +80,9 @@ export function {{classname}}ToJSON(value?: {{classname}}): any { return undefined; } return { + {{#additionalPropertiesType}} + ...value, + {{/additionalPropertiesType}} {{#vars}} {{^isReadOnly}} {{#isPrimitiveType}}