Skip to main content

Openapi Ts

Generate typescript clients for OpenAPI (e.g. FastAPI) apps, using openapi-ts

Usage

Make sure you have openapi-ts installed:

npm -g i @hey-api/openapi-ts
from fastapi import FastAPI
from pydantic import BaseModel
from openapi_ts import generate_client

# define your app
app = FastAPI(generate_unique_id_function=lambda route: route.name)

class User(BaseModel):
  name: str
  email: str

@app.get('/users')
def get_users(how_many: int | None = None) -> list[User]:
  ...

# generate client
generate_client(app.openapi(), 'path/to/client')

Read more

  • See a full walkthrough of fastapi x openapi-ts in the FastAPI docs
  • For configuration and more of openapi-ts, see their website

Metadata

Release files for openapi-ts 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openapi-ts 0.1.4
File Size Uploaded Provenance Actions
openapi_ts-0.1.4.tar.gz 2.3 kB Without provenance Details for openapi_ts-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openapi-ts 0.1.4
File Interpreter ABI Platform Actions
openapi_ts-0.1.4-py3-none-any.whl Python 3 none any Details for openapi_ts-0.1.4-py3-none-any.whl

Total release size: 5.2 kB

Release files / openapi_ts-0.1.4.tar.gz

Download URL openapi_ts-0.1.4.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
75940f184173de3c67c05c41e4a4f10ec03ddee5c79b8f46168cfdb572b3e149
BLAKE2b-256 checksum
How to use checksums
bdf858162aa03e81a2655b8dfb5900902f453853884351a1846371a0e6c319ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.10

Release files / openapi_ts-0.1.4-py3-none-any.whl

Download URL openapi_ts-0.1.4-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a6e755943ee1e42bd102715402154ddc0325941901db1e36a27de670589ee21
BLAKE2b-256 checksum
How to use checksums
1373127dd9df9cb2df5228f1494f961e6b4f7735903f1dc7c84f2b7cf7cacee9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.10

Security for openapi-ts 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page