swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
17.05k stars 6.03k forks source link

codegen swagger 3 support for python #8972

Open tjhgit opened 5 years ago

tjhgit commented 5 years ago
Description

I was expecting that codegen support a swagger3 specification and can create python client and flask code. However it seems that only still swagger2 specification is supported.

Swagger-codegen version

latest

silver8ack commented 5 years ago

Yep... the documentation is pretty bad here too. Doesn't appear there's any support for python for openapi spec 3. The docs should be cleaned up to show this.

crawforde commented 5 years ago

I’m also running into problems with python codegen. I was just tasked with generating a python client for an api using openapi 3 (previously, we were generating only java and js clients, which worked fine). I updated our pom file and got the generator to spit out what looked like legit python code, but the package is completely broken in both python 2 and 3. Any time I try to make a request with the DefaultApi using the same code shown in the README, I get the following error: list_routers() takes exactly 1 argument (2 given). In my case, list_routers is a function in the DefaultApi class that takes a ListRoutersRequest instance. I’ve tried numerous variations to the code shown in the README, but nothing fixes the issue. This is very frustrating, and I hope Swagger is able to address the problem soon.

meyerson commented 4 years ago

@tjhgit - has this been resolved? - is there a fix somewhere?