mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Merge 7408251e63ba8ee0716a5c388026d844b4b62a77 into d6c46342693205f0dae441b45742d9c85d41cf33
This commit is contained in:
commit
d14baec4b0
@ -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}}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user