jarvisbox

OpenAPI a tipos TypeScript

Convierte especificaciones OpenAPI 3.x o Swagger 2.0 a tipos TypeScript en tu navegador. Genera interfaces paths y components — sin npm ni CLI necesarios.

100% in your browser. Your file never leaves your device.

Paste an OpenAPI JSON or YAML spec and click Generate TypeScript.

How to convert OpenAPI to TypeScript types in browser

  1. 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.
  2. Click Generate TypeScript. The tool parses your spec entirely in the browser and produces a typed .d.ts file containing paths, components.schemas, and a createClient<paths>() snippet.
  3. Click Copy to paste the types directly into your editor, or click Download to save a types.d.ts file 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

Preguntas frecuentes

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:

Reportar un problema con esta herramienta