Recursively infers a TypeScript type from a statically-known JSON Schema node.
Requires as const on the input object for precise inference —
without it TypeScript widens string literals to string and inference
collapses to unknown.
Type Parameters
S
Example
typeUser = InferFromJsonSchema<typeofUserJsonSchema>; // { name: string; age?: number }
Recursively infers a TypeScript type from a statically-known JSON Schema node.
Requires
as conston the input object for precise inference — without it TypeScript widens string literals tostringand inference collapses tounknown.