This repository was archived by the owner on Dec 25, 2024. It is now read-only.
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
[BUG] Invalid function names based on strings containing # and digits #70
Closed
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Invalid function names are generated from enum
string values resembling "#367B9C"
.
openapi-generator version
latest
via docker CLI
OpenAPI declaration file content or url
Minimal reproduction: gist, validated with vacuum
Generation Details
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:latest generate --global-property skipFormModel=false -i /local/color-names.json -g python -o /local/openapi-client
Steps to reproduce
After generating, install generated code and run pytest
.
Output:
openapi-client\test\test_paths\test_sample_json\test_post.py:15: in <module>
from openapi_client.paths.sample_json import post # noqa: E501
E File "C:\Users\Work\Code\openapi-generator-repros\openapi-client\openapi_client\paths\sample_json\post.py", line 90
E def 67B9C(cls):
E ^
E SyntaxError: invalid decimal literal
Original bug from: OpenAPITools/openapi-generator#13942