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
Is your feature request related to a problem? Please describe.
Attempting to parse an Enum with spaces in it causes an error.
Example component:
SampleComponent:
type: objectproperties:
reason:
type: stringdescription: Component that won't parseenum:
- Made in error
- Other
Produces an Enum entry with a name MADE IN ERROR which is invalid and results in models/reason.py: Cannot parse: 5:9: MADE IN ERROR = "Made in error"
Describe the solution you'd like
Replace spaces (and probably other similar characters) with underscore to produce:
classReason(str, Enum):
MADE_IN_ERROR="Made in error"OTHER="Other"
This could introduce some naming collision if say we had both "Made in error" and "Made:in:error" but that seems like this would solve almost all reasonable cases.
Describe alternatives you've considered
Currently we are not able to use an Enum for this.
The text was updated successfully, but these errors were encountered:
For clarification, this only seems to happen when it's defined under components. If it's just left as part of the request body definition, however, the file creates the class as expected but does not appear to import Enum.
Is your feature request related to a problem? Please describe.
Attempting to parse an Enum with spaces in it causes an error.
Example component:
Produces an
Enum
entry with a nameMADE IN ERROR
which is invalid and results inmodels/reason.py: Cannot parse: 5:9: MADE IN ERROR = "Made in error"
Describe the solution you'd like
Replace spaces (and probably other similar characters) with underscore to produce:
This could introduce some naming collision if say we had both "Made in error" and "Made:in:error" but that seems like this would solve almost all reasonable cases.
Describe alternatives you've considered
Currently we are not able to use an
Enum
for this.The text was updated successfully, but these errors were encountered: