Merge 7408251e63ba8ee0716a5c388026d844b4b62a77 into d6c46342693205f0dae441b45742d9c85d41cf33

This commit is contained in:
Ivan Vaskevych 2025-05-09 17:00:00 +02:00 committed by GitHub
commit d14baec4b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,9 @@ export type {{classname}} = {{#oneOf}}{{{.}}}{{^-last}} | {{/-last}}{{/oneOf}};
*/
export class {{classname}}Class {
{{#discriminator}}
// This will get transformed to contentType if the content_type is used as a discriminator in the OpenAPI spec
// It will then fail in runtime during deserialization with the error "TypeError: typeMap[type].getAttributeTypeMap is not a function"
// We need to make sure "content_type" is used, or that the "content_type" is transformed to "contentType" (might not be desirable)
static readonly discriminator: string | undefined = "{{discriminatorName}}";
{{/discriminator}}
{{^discriminator}}
@ -37,4 +40,4 @@ export class {{classname}}Class {
static readonly mapping: {[index: string]: string} | undefined = undefined;
{{/hasDiscriminatorWithNonEmptyMapping}}
}
}