Skip to content

generated package names start with numbers if tag starts with a number #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
iamnoah opened this issue May 17, 2021 · 2 comments · Fixed by #448
Closed

generated package names start with numbers if tag starts with a number #428

iamnoah opened this issue May 17, 2021 · 2 comments · Fixed by #448
Labels
🐞bug Something isn't working
Milestone

Comments

@iamnoah
Copy link

iamnoah commented May 17, 2021

Describe the bug

See title.

To Reproduce

Generate a client from this Swagger: https://converter.swagger.io/api/convert?url=https://integration-www.tangocard.com/raas_api_console/v2/api-docs/swagger.json

The package names will start with a number and be un-importable.

Expected behavior

Number is dropped.

OpenAPI Spec File

https://converter.swagger.io/api/convert?url=https://integration-www.tangocard.com/raas_api_console/v2/api-docs/swagger.json

@iamnoah iamnoah added the 🐞bug Something isn't working label May 17, 2021
@dbanty dbanty added this to the Next milestone May 17, 2021
@dbanty
Copy link
Collaborator

dbanty commented May 17, 2021

Thanks for reporting! I'll make sure to get this into the next release.

@dbanty
Copy link
Collaborator

dbanty commented Jun 13, 2021

After some investigation, I'm going to fix this in the next breaking version. It's possible that the fix won't impact any already-valid names, but there is a chance some edge cases will be modified.

@dbanty dbanty modified the milestones: 0.9.2, 0.10.0 Jun 13, 2021
dbanty added a commit that referenced this issue Jul 5, 2021
…. Thanks @iamnoah & @forest-benchling!

* fix!: Turn all tags (endpoints) into valid Python identifiers [WIP]

* test: Fix all failing unit tests

* test: Add e2e test for tag beginning with number

* chore(deps): Update deps, add dataclasses types for Python 3.6

* refactor: Switch _PythonIdentifier to a public custom class in `utils`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
2 participants