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>