How to generate python HTTP clients that consume OpenAPI / Pydantic / FastAPI specs
[PYTHON] update to pydantic v2
python - How to configure openapi-generator-cli to include examples in Pydantic models - Stack Overflow
openapi - Generate Open API spec from Pydantic with references to discriminators - Stack Overflow
Videos
» pip install openapi-pydantic
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_client is abandonware, and datamodel-code-generator looks 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.
» pip install openapi-schema-pydantic
» pip install flask-pydantic-openapi
» pip install apiclient-pydantic-generator