Skip to content
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
5 of 6 tasks
spacether opened this issue Nov 8, 2022 · 0 comments · Fixed by #72
Closed
5 of 6 tasks

[BUG] Invalid function names based on strings containing # and digits #70

spacether opened this issue Nov 8, 2022 · 0 comments · Fixed by #72
Labels
bug Something isn't working

Comments

@spacether
Copy link
Contributor

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

@spacether spacether added the bug Something isn't working label Nov 8, 2022
@spacether spacether linked a pull request Nov 10, 2022 that will close this issue
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant