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 c56a9e9192c1..c5fe673cf373 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/modelGeneric.mustache @@ -4,12 +4,24 @@ import { exists, mapValues } from '../runtime'; import type { {{{.}}} } from './{{.}}'; import { {{.}}FromJSON, +{{^discriminator}} {{.}}FromJSONTyped, +{{/discriminator}} {{.}}ToJSON, } from './{{.}}'; {{/imports}} {{/hasImports}} +{{#legacyDiscriminatorBehavior}} + {{#discriminator}} + import { + {{#discriminator.mappedModels}} + {{modelName}}FromJSONTyped{{^-last}},{{/-last}} + {{/discriminator.mappedModels}} + } from './'; + + {{/discriminator}} +{{/legacyDiscriminatorBehavior}} {{>modelGenericInterfaces}} /**