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}}