OpenAPI 3.2
QUERY operations, sequential media types, multi-file documents, and JSON Schema 2020-12. oasis-gen also accepts OpenAPI 3.0 and 3.1 documents.
One dependency-free TypeScript file, with types for every operation and a small fetch-based runtime.
npx oasis-gen openapi.yaml -o src/api.tsimport { createClient } from "./api.ts";
const api = createClient({ baseUrl: "https://api.example.com" });
const res = await api.GET("/pets/{petId}", { path: { petId: 1 } });
if (res.status === 200) {
res.data.name; // typed from the 200 response
} else if (res.status === 404) {
res.data.title; // typed from the 404 response
}