From 77a1089f692bdd659108d9a66b5aed58178326d3 Mon Sep 17 00:00:00 2001 From: pginoux Date: Thu, 2 Nov 2023 18:00:17 +0100 Subject: [PATCH] fix: sdk generated with inner enums --- .../resources/typescriptFetch/model/reviver.mustache | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/@ama-sdk/schematics/schematics/typescript/core/openapi-codegen-typescript/src/main/resources/typescriptFetch/model/reviver.mustache b/packages/@ama-sdk/schematics/schematics/typescript/core/openapi-codegen-typescript/src/main/resources/typescriptFetch/model/reviver.mustache index d0b97524bd..fa11ea7619 100644 --- a/packages/@ama-sdk/schematics/schematics/typescript/core/openapi-codegen-typescript/src/main/resources/typescriptFetch/model/reviver.mustache +++ b/packages/@ama-sdk/schematics/schematics/typescript/core/openapi-codegen-typescript/src/main/resources/typescriptFetch/model/reviver.mustache @@ -27,7 +27,7 @@ import { utils, reviveArray, reviveMap, reviveDictionarizedArray } from '@ama-sd {{#models}} {{#model}} - {{^isEnum}} + {{^isEnum}}{{^isEnumRef}} export function revive{{classname}}(data: undefined, dictionaries?: any): undefined; export function revive{{classname}}(data: {{classname}}, dictionaries?: any): {{classname}} {{#discriminator}}{{#vendorExtensions}}{{#x-discriminator-subtypes}}| {{.}}{{/x-discriminator-subtypes}}{{/vendorExtensions}}{{/discriminator}}; export function revive{{classname}}(data: any, dictionaries?: any): {{classname}} {{#discriminator}}{{#vendorExtensions}}{{#x-discriminator-subtypes}}| {{.}}{{/x-discriminator-subtypes}}{{/vendorExtensions}}{{/discriminator}} | undefined; @@ -119,7 +119,7 @@ export function revive{{classname}}(dat {{#allVars}} {{^isPrimitiveType}} {{#complexType}} - {{^isEnum}} + {{^isEnum}}{{^isEnumRef}} {{#isMap}} {{#vendorExtensions}} {{^nonObjectDefinition}} @@ -143,12 +143,12 @@ export function revive{{classname}}(dat {{/vendorExtensions}} {{/isArray}} {{/isMap}} - {{/isEnum}} + {{/isEnumRef}}{{/isEnum}} {{/complexType}} {{^complexType}} - {{^isEnum}} + {{^isEnum}}{{^isEnumRef}} data{{#propertyAccess}}{{baseName}}{{/propertyAccess}} = data.{{baseName}} ? new {{{dataType}}}(data{{#propertyAccess}}{{baseName}}{{/propertyAccess}}) : undefined; - {{/isEnum}} + {{/isEnumRef}}{{/isEnum}} {{/complexType}} {{/isPrimitiveType}} {{/allVars}} @@ -158,7 +158,7 @@ export function revive{{classname}}(dat return data as T; } - {{/isEnum}} + {{/isEnumRef}}{{/isEnum}} {{#isEnum}} /** As the definition is not an object, no reviver is needed */ {{/isEnum}}