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
Desktop (please complete the following information):
OS: macOS 10.15.4
Python Version: 3.8.0
openapi-python-client version: 0.6.0-alpha.3
A potential solution for this would be to adjust naming for negative integers to handle the hyphen, i.e. instead of -1 becoming VALUE_-1, have it become VALUE_NEGATIVE_1.
Describe the bug
Including negative integers in enums results in model class variables with invalid Python names. For example, this schema snippet:
will produce a model class:
where
VALUE_-1
as a variable name will result in Python errors.To Reproduce
openapi-python-client generate --path path/to/openapi.yaml
, where the spec contains an enum with negative integers in a schemaExpected behavior
Expected negative integers in enums to result in valid variable names in model classes.
OpenAPI Spec File
https://gist.github.com/rweinberger/3fec7b999dc9f4659f28ce3be7c13193
Desktop (please complete the following information):
A potential solution for this would be to adjust naming for negative integers to handle the hyphen, i.e. instead of
-1
becomingVALUE_-1
, have it becomeVALUE_NEGATIVE_1
.cc @dtkav
The text was updated successfully, but these errors were encountered: