We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tested on generators:
Given:
Whe:
Then
Should:
Old behavior: Generated code with discriminators not compiling
No discriminators:
export class Base { 'str': string; 'i': number; static readonly discriminator: string | undefined = undefined; static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "str", "baseName": "str", "type": "string", "format": "" }, { "name": "i", "baseName": "i", "type": "number", "format": "int32" } ]; static getAttributeTypeMap() { return Base.attributeTypeMap; } public constructor() { } } export class A { 'str': string; static readonly discriminator: string | undefined = undefined; static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "str", "baseName": "str", "type": "string", "format": "" } ]; static getAttributeTypeMap() { return A.attributeTypeMap; } public constructor() { } }
Expected Behavior (current):
export class Base { 'type'?: string; 'i': number; 'l': number; static readonly discriminator: string | undefined = "type"; static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "type", "baseName": "type", "type": "string", "format": "string" }, { "name": "i", "baseName": "i", "type": "number", "format": "int32" }, { "name": "l", "baseName": "l", "type": "number", "format": "int64" } ]; static getAttributeTypeMap() { return Base.attributeTypeMap; } public constructor() { this.type = "Base"; } } export class B { 'i': number; 'type'?: string; static readonly discriminator: string | undefined = "type"; static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ { "name": "i", "baseName": "i", "type": "number", "format": "int32" }, { "name": "type", "baseName": "type", "type": "string", "format": "string" } ]; static getAttributeTypeMap() { return B.attributeTypeMap; } public constructor() { this.type = "B"; } }
#90
The text was updated successfully, but these errors were encountered:
PR Accepted
Sorry, something went wrong.
@Wicpar Thanks, is that possible to generate beta build from that?
Yes I'm waiting for another pr though
No branches or pull requests
Tested on generators:
Given:
Whe:
Then
Should:
Old behavior:
![image](https://user-images.githubusercontent.com/13859373/110255708-623dbd00-7f95-11eb-99f6-30e8e5af2974.png)
Generated code with discriminators not compiling
No discriminators:
Expected Behavior (current):
#90
The text was updated successfully, but these errors were encountered: