Closed
Description
Describe the bug
parser/properties/__init__.py(242)build_model_property()
does not contain the same "hack" that's present at parser/reference.py(23)from_ref()
, which removes spaces from the class name to prevent "ugly pascalcase output".
This occurs in my own schema generation when a model has a title
and that title has spaces. In this particular case, that's Noise Model
which gets pascal-ized to Noisodel
.
Two ways to fix:
- Same inline hack as in
parser/reference.py
- Strip the spaces within
utils.py(28)pascal_case()
itself so the fix is everywhere
To Reproduce
Generate from a schema with an object that has a title
with spaces in it.
Expected behavior
Noise Model
becomes a python model called NoiseModel
rather than Noiseodel
Desktop (please complete the following information):
- OS: OSX 10.15
- Python Version: 3.8.2
- openapi-python-client version: 0.7.2
Additional context
>.../python3.8/site-packages/openapi_python_client/utils.py(32)pascal_case()
-> return fix_keywords(stringcase.pascalcase(sanitize(value)))
(Pdb) value
'Noise Model'
(Pdb) stringcase.pascalcase(sanitize(value))
'Noisodel'