Skip to content
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

fails to generate Python client with openapi generator #38

Open
ekoby opened this issue Aug 9, 2023 · 2 comments
Open

fails to generate Python client with openapi generator #38

ekoby opened this issue Aug 9, 2023 · 2 comments

Comments

@ekoby
Copy link
Member

ekoby commented Aug 9, 2023

run generator:
$ openapi-generator-cli generate -g python -o ./python -i client.yml

Error:

Exception in thread "main" java.lang.RuntimeException: Your spec version of 2.0 is too low. python only works with specs with version >= 3.X.X. Please use a tool like Swagger Editor or Swagger Converter to convert your spec to v3
	at org.openapitools.codegen.languages.PythonClientCodegen.preprocessOpenAPI(PythonClientCodegen.java:2773)
	at org.openapitools.codegen.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:272)
	at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:935)
	at org.openapitools.codegen.cmd.Generate.execute(Generate.java:487)
	at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
@sabedevops
Copy link

@ekoby You need to pull the latest version of that image or instead use the python-prior generator for V2 support. In later versions of their project, python-prior is removed and V2 function is merged with the python generator.

Relevant discussion on breakage in the newest version and why I recommend python-prior approach: https://openziti.discourse.group/t/management-api-authentication/1480/31

@ekoby
Copy link
Member Author

ekoby commented Aug 15, 2023

Python was just a side quest as I was looking into generating other clients (see #39).
In my opinion we should support latest tools out of the box, or at least document needed workarounds in the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants