FastAPI/Idea/Create Python SDK from OpenAPI
Properties
- tags
- Idea, OpenAPI, SDK
- FastAPI/Reddit 2024/05
- How to generate python HTTP clients that consume OpenAPI / Pydantic / FastAPI specs : r/FastAPI
- Original Poster
- I'm looking for a framework that will produce python libraries that can consume my pydantic-typed FastAPI endpoints in both sync and async contexts.
Generate Clients - FastAPI links to OpenAPI Generator, which apparently has a python generator: Documentation for the python Generator | OpenAPI Generator, but the documentation looks kind of sparse. Can someone link me to a tutorial about how to use it for FastAPI / Pydantic? Note, it also links to Speakeasy, which looks great if you work for a fortune 50 company or something; pricing is expensive.
- I've also seen a few discussion threads in FastAPI about this, for example Client with the same awesomeness? · Issue #85 · tiangolo/fastapi
Does anyone know a library that can consume a swagger file and provide nice interface for interacting with the API (something similar what suds did for SOAP) ? I'm particularly after auto-generated Pydantic definitions of swagger request/response objects. I think u/dmontagu 's fastapi_client and @koxudaxi 's datamodel-code-generator ...
- It looks like
fastapi_clientis abandonware, anddatamodel-code-generatorlooks cool but AFAICT it's not generating a python client but some client data models. Not sure what the use case is there, if you start out using pydantic with fastapi.
- I'm looking for a framework that will produce python libraries that can consume my pydantic-typed FastAPI endpoints in both sync and async contexts.
- Comment
- Original Poster
- How to generate python HTTP clients that consume OpenAPI / Pydantic / FastAPI specs : r/FastAPI