Internet Toolset

Comprehensive Tools for Webmasters, Developers & Site Optimization

JSON Schema → TypeScript Interface

JSON Schema → TypeScript Interface

Convert complex JSON Schemas into fully‑typed TypeScript interfaces:

  • Supports enum, oneOf/anyOf → union types.
  • Recursively generate nested interfaces for object properties.
  • Emit JSDoc comments from schema description.
  • Toggle readonly and trailing semicolons.
Core Example

Input Schema:

{ "type":"object", "properties":{ "id": { "type":"integer", "description":"Unique ID" }, "status": { "enum":["new","ready","done"], "description":"Current state" }, "profile": { "type":"object", "description":"User profile", "properties":{ "age":{ "type":"number" }, "tags":{ "type":"array","items":{"type":"string"} } }, "required":["age"] } }, "required":["id","status"] }

Options: Name: Item  |  nested: ✔  |  jsdoc: ✔  |  readonly: ✔  |  semicolon: ✖

Output:

export interface Item_Profile { tags?: string[] age: number } export interface Item { /** Unique ID */ readonly id: number /** Current state */ readonly status: "new" | "ready" | "done" /** User profile */ readonly profile?: Item_Profile }

Use this when generating TS bindings for APIs, forms, or config schemas directly from your JSON Schema definitions.