[typescript-fetch] support additional properties (#3325)

This commit is contained in:
hello-brsd 2019-07-15 07:59:01 +02:00 committed by Esteban Gehring
parent 3eac8391f5
commit 2fbf0f33b3

View File

@ -31,6 +31,9 @@ export interface {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{
export function {{classname}}FromJSON(json: any): {{classname}} { export function {{classname}}FromJSON(json: any): {{classname}} {
{{#hasVars}} {{#hasVars}}
return { return {
{{#additionalPropertiesType}}
...json,
{{/additionalPropertiesType}}
{{#vars}} {{#vars}}
{{#isPrimitiveType}} {{#isPrimitiveType}}
{{#isDate}} {{#isDate}}
@ -77,6 +80,9 @@ export function {{classname}}ToJSON(value?: {{classname}}): any {
return undefined; return undefined;
} }
return { return {
{{#additionalPropertiesType}}
...value,
{{/additionalPropertiesType}}
{{#vars}} {{#vars}}
{{^isReadOnly}} {{^isReadOnly}}
{{#isPrimitiveType}} {{#isPrimitiveType}}