-
-
Notifications
You must be signed in to change notification settings - Fork 547
Open
Description
Hello,
We have the following situation where we have an Enum with negative and positive numbers as keys to the Enum and the keys generated in typescript collide for negative numbers with positive numbers.
Java code
public enum property {
NOT_SET(-1, ""),
NONE(0, "none"),
SOME_VALUE(1, "some_value"),
SOME_OTHER_VALUE(2, "some_other_value"),
EXTRA_VALUE(3, "extra_value")
}Swagger json
{
"property": {
"type": "string",
"enum": [
"-1",
"0",
"1",
"2",
"3"
]
}
}Generated Typescript
export namespace MyClass {
export enum property {
_1 = '-1', // error same key
_0 = '0',
_1 = '1', // error same key
_2 = '2',
_3 = '3'
}
}Possible issue here
cben and adobi
Metadata
Metadata
Assignees
Labels
No labels