devpocket.dev

JSON Schema to Types

Generate TypeScript types, Zod schemas, or Pydantic v2 models from JSON Schema.

Runs locally
Loading tool…

How to use

Paste a JSON Schema, choose an output target, and set the root type name. The converter handles objects, arrays, enums, constants, nullable values, anyOf/oneOf, simple object allOf merges, local $ref values under $defs or definitions, and common string formats.

Descriptions become JSDoc comments, Zod .describe() metadata, or Pydantic Field descriptions. Generated code is a starting point: review custom keywords, constraints, and naming before using it in production.

FAQ

Which JSON Schema draft is supported?

The converter accepts the common structural keywords shared by modern drafts, including both $defs and the older definitions container.

Does it resolve external $ref URLs?

No. Only local references beginning with #/$defs/ or #/definitions/ are accepted so the tool remains fully local and deterministic.

Are all validation constraints preserved?

Structural types and listed formats are preserved. Numeric bounds, regex patterns, dependent schemas, conditional schemas, and custom keywords are not currently emitted.

Related tools