OpenAPI to TypeScript Converter
Paste an OpenAPI 3.x or Swagger 2.0 spec (JSON or YAML) and generate TypeScript interfaces, types, and API operation types. Handles $ref resolution, allOf/oneOf/anyOf, enums, and nested objects.
Options
How It Works
Schema Conversion
Extracts all schemas from components.schemas (OpenAPI 3.x) or definitions (Swagger 2.0) and generates TypeScript interfaces or type aliases with proper types, optional fields, and nested objects.
$ref Resolution
Follows $ref pointers within the spec to resolve references to other schemas, producing clean type names (e.g., $ref: "#/components/schemas/Pet" → Pet).
Composition Types
Handles allOf (intersection types), oneOf and anyOf (union types), and enum values as string literal unions.
API Operation Types
Optionally generates typed path parameters, query parameters, request bodies, and response types from your API's path definitions. Uses operationId for naming.
Supported Features
Type | nullRecord<string, T>Related Convert Tools
JSON to CSV Converter
Convert JSON arrays to CSV with nested object flattening, column selection, and .csv download
TOML ↔ JSON/YAML
Convert between TOML, JSON, and YAML — perfect for Cargo.toml and pyproject.toml
Encode / Decode Multi-Tool
Base64, Base32, Hex, Binary, URL, and HTML encoding & decoding all in one tool
HTML to JSX Converter
Convert HTML to JSX instantly — class to className, inline styles to objects, self-closing tags, SVG attributes, event handlers, and more