OpenAPI → TypeScript 型変換
ブラウザで OpenAPI 3.x または Swagger 2.0 仕様を TypeScript 型に変換。paths と components インターフェイスを生成 — npm も CLI も不要。
Paste an OpenAPI JSON or YAML spec and click Generate TypeScript.
How to convert OpenAPI to TypeScript types in browser
- Paste your OpenAPI 3.x or Swagger 2.0 spec (JSON or YAML) into the input area above. You can use the sample spec that appears as placeholder text as a starting point.
-
Click Generate TypeScript. The tool parses your spec entirely in the browser
and produces a typed
.d.tsfile containingpaths,components.schemas, and acreateClient<paths>()snippet. -
Click Copy to paste the types directly into your editor, or click
Download to save a
types.d.tsfile ready to drop into your TypeScript project.
Why generate TypeScript types from OpenAPI in the browser?
The standard approach — npx openapi-typescript spec.yaml -o types.d.ts — requires
Node.js installed locally. That is a blocker on Chromebooks, locked-down corporate machines,
CI environments without npm, or when you just want a quick type file without spinning up a dev
environment. This tool removes that requirement entirely: paste and download in seconds, no
terminal needed.
The output follows the same paths + components interface convention
used by openapi-typescript and is
directly compatible with openapi-fetch and TanStack Query.
Related tools
- YAML Validator — check your OpenAPI YAML for syntax errors before converting
- JSON Formatter — pretty-print your OpenAPI JSON spec
- JSON Schema Validator — validate request/response payloads against a JSON Schema
- YAML Formatter — format and tidy your YAML before generating types
- Generate types from OpenAPI YAML
- Generate types from OpenAPI JSON
- OpenAPI 3.x to TypeScript types
- Swagger 2.0 to TypeScript types
- OpenAPI to React Query types
よくある質問
- Does my OpenAPI spec leave my device?
- No. The entire conversion runs locally in your browser using JavaScript. Your spec is never sent to any server — paste it, click Generate, and download the .d.ts file. Works offline too.
- Which OpenAPI versions are supported?
- OpenAPI 3.0.x, 3.1.x, and Swagger 2.0 are all supported. Paste JSON or YAML — the tool auto-detects the format using the js-yaml parser. All common schema constructs are handled: $ref, allOf, anyOf, oneOf, enum, nullable, and additionalProperties.
- Do I need Node.js or npm installed?
- No. This tool runs entirely in your browser. There is no CLI to install and no npm package needed. It is designed specifically for developers who want TypeScript types without a Node.js build step — on Chromebooks, locked-down machines, or in quick prototyping sessions.
- What does the output look like?
- The output is a .d.ts file with three sections: an "paths" interface mapping every route and HTTP method to its parameters and responses; a "components.schemas" interface with all your schema types; and a typed createClient<paths>() declaration you can drop into a fetch wrapper.
- Is there a file size or schema count limit?
- There is no enforced limit — the generator handles specs with hundreds of schemas and dozens of paths. Very large specs (1MB+) may take a second or two to parse, but there is no hard cap.
- Can I use the output with openapi-fetch or SWR?
- Yes. The paths interface shape is compatible with openapi-typescript and openapi-fetch. You can pass it directly to createClient<paths>() from openapi-fetch, or use it with any typed fetch helper that accepts the openapi-typescript interface convention.
Last updated: By jarvisbox