JSON Schema → TypeScript
Emit TypeScript types from a JSON Schema — enum/oneOf/allOf/$ref/definitions all handled.
TypeScript
export type Profile = {
name: string;
age?: number;
};
export type User = {
id: number;
email: string;
role?: "admin" | "user" | "guest";
profile?: Profile;
tags?: string[];
createdAt?: string;
};What we handle
type— string / number / integer / boolean / null / array / objectenum→ literal unionsoneOf/anyOf→ union typesallOf→ intersection types$refwithin the same document (#/definitions/Fooor#/$defs/Foo)required— fields not listed become optional
Not handled
External $refs, patternProperties, and complex validation keywords (format, min/max,pattern) don't affect TypeScript types so they're dropped silently.
You might also like
- CSV ↔ JSON ConverterConvert CSV to JSON or JSON to CSV with quoted fields and configurable delimiters.
- cURL ConverterParse a curl command and emit fetch, Node https, Python requests, Ruby Net::HTTP, Go net/http, PowerShell, HTTPie, and wget equivalents.
- Data Size ConverterConvert between bytes, kilobytes, megabytes, gigabytes, bits, and their binary (KiB, MiB) cousins.
- IP Address ConverterConvert IPv4 between dotted decimal, integer, hex, and binary notations. Compress and expand IPv6.