You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
INT enums
enum: [1,10,20]
map to VALUE_1, VALUE_10, VALUE_20 ....
but you can't have mixed str&int enums.
I have some enums in an openapi file that take both numbers and strings. ex: 1,20,noop
So the numbers need to be strings as well.
But since they start with an invalid char ([0-9]) they're renamed VALUE_1, VALUE_2, etc regardless of the int/string value
I think a similar thing happens to strings that start as _.
It's worse then passing in a string(especially since you can't pass in the string/value instead).
Its better to keep the string value after the prefix.
The text was updated successfully, but these errors were encountered:
rtaycher
changed the title
feat: Add a enum_value_prefix similar to field_prefix and/or allow numerical string enums to also be VALUE_$X
feat: Add a enum_value_prefix similar to field_prefix and/or allow enum values that start with a bad chart to still be VALUE_$X
May 14, 2024
Describe the bug
INT enums
enum: [1,10,20]
map to VALUE_1, VALUE_10, VALUE_20 ....
but you can't have mixed str&int enums.
I have some enums in an openapi file that take both numbers and strings. ex: 1,20,noop
So the numbers need to be strings as well.
But since they start with an invalid char ([0-9]) they're renamed VALUE_1, VALUE_2, etc regardless of the int/string value
I think a similar thing happens to strings that start as _.
It's worse then passing in a string(especially since you can't pass in the string/value instead).
Its better to keep the string value after the prefix.
basically I'd like to be able to have
enum: ["200", "10", "_11", "_ABC", "noop"]
map to
with
enum_value_prefix: V
OpenAPI Spec File
Openapi doesn't have great support for custom enum naming.
I think this would work better in many cases anyway
https://stackoverflow.com/questions/66465888/how-to-define-enum-mapping-in-openapi
The text was updated successfully, but these errors were encountered: