Maps a JSON Schema structure to a TypeScript type. Works with as const literals -- provides full autocomplete for fields.
as const
fields
Supports all JSON Schema draft versions (04-2020-12) and OpenAPI 3.x:
["string", "null"]
string | null
Record<string, V>
Record<string, T>
T[]
discriminator
The Mode parameter controls how readOnly / writeOnly keywords influence inferred object properties — see FromJSONSchemaMode.
Mode
readOnly
writeOnly
Maps a JSON Schema structure to a TypeScript type. Works with
as constliterals -- provides full autocomplete forfields.Supports all JSON Schema draft versions (04-2020-12) and OpenAPI 3.x:
["string", "null"]->string | null(nullable)Record<string, V>Record<string, T>T[]discriminatoris set)The
Modeparameter controls howreadOnly/writeOnlykeywords influence inferred object properties — see FromJSONSchemaMode.