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
openapi_ts-0.1.4.tar.gz 2.3 kB Details

Built distribution (wheel)

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

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

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

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