Description
I'm looking for a tool that could generate pydantic's models from swagger/openai yaml/json ?
It should exists, no ?
I develop code generator for pydantic model from openapi yaml/json.
https://github.com/koxudaxi/datamodel-code-generator
Also, Our company uses the code generator for the production api server.
If you have a request, suggest then, Welcome Any feedback, PR.
I've tested ^^
But it doesn't seem to work for my swagger (v2) ;-(
I don't have time to explore why (miss key "components" during process)
Sorry, the code generator doesn't support swagger(v2) :(
I recommend converting swagger(v2) to openapi(v3).
If a lot of people request to support swagger(v2) then, We will implement it. 馃槃
@manatlan you can also search for a tool to convert from Swagger v2 to OpenAPI (Swagger) v3. And then use @koxudaxi's code generator with that.
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.
Most helpful comment
Sorry, the code generator doesn't support swagger(v2) :(
I recommend converting swagger(v2) to openapi(v3).
If a lot of people request to support swagger(v2) then, We will implement it. 馃槃