jarvisbox

Generate TypeScript types from OpenAPI JSON

Paste your openapi.json and get a typed .d.ts file with paths and components — runs 100% in your browser, no server upload.

Many API frameworks expose their OpenAPI spec at a /openapi.json or /v3/api-docs endpoint. This JSON document is machine-generated and already parsed — you just need to convert its schemas into TypeScript types so your client code is type-checked against the server contract.

The standard tool for this is openapi-typescript, which runs as a Node.js CLI. But if you need types quickly — on a machine without Node, in a CI pipeline that does not have npm available, or just to preview what the types look like — this browser-based generator gives you the same output in seconds.

The generator detects JSON automatically (any input starting with {) and skips the YAML parse step, making it slightly faster for large JSON specs. It handles every common OpenAPI 3.x and Swagger 2.0 JSON pattern: $ref, allOf, anyOf, oneOf, enum, nullable, and additionalProperties.

How to convert openapi.json to TypeScript

  1. Copy the JSON from your server's /openapi.json endpoint (or open the file locally). Go to OpenAPI to TypeScript Types and paste the JSON into the text area.
  2. Click Generate TypeScript. The generator parses the JSON in your browser and emits a .d.ts with paths, components.schemas, and a createClient<paths>() declaration.
  3. Click Download to save types.d.ts, or Copy to paste it directly into your IDE. Import and use it with any typed fetch wrapper.

Importing the generated types

Drop types.d.ts into your project and use it like this:

import type { paths } from "./types";
import createClient from "openapi-fetch";

const client = createClient<paths>({ baseUrl: "https://api.example.com" });

const { data, error } = await client.GET("/users/{id}", {
  params: { path: { id: 42 } },
});

Related tools

Report a problem with this tool