npm / json-schema-to-typescript
json-schema-to-typescript
What changed in json-schema-to-typescript 16, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
6 breaking2 performance2 behavior and defaults1 tooling14 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initjson-schema-to-typescript 1625 changes
Breaking changes 6
Relative references are resolved against each schema file's directory rather than process.cwd(); an explicit --cwd still takes precedence.
Draft-3 and Swagger 2 property-level required: true now causes the property to be emitted as required.
A named enum in a position with no name degrades to a union of literals instead of emitting a nameless enum declaration.
The JSON null value is treated as type: "null" instead of as an untyped object.
A root or untitled definition with an array type and properties now emits the union including non-object members, rather than making those members unreachable.
unreachableDefinitions now declares definitions even when declareExternallyReferenced is off.
Performance 2
compile() no longer scans every definition once per parsed node, making schemas with thousands of definitions compile much faster without changing generated output.
Formatting large, mostly quote-free outputs is several times faster; a caller's style.filepath still takes precedence.
Behavior and default changes 2
Short unions that fit on one line are no longer wrapped.
The description of an inline items schema is included in the array declaration's JSDoc as an Items paragraph.
Tooling 1
Generated type names can no longer start with a digit or collapse to an empty name.
Fixes and other changes 14
Members containing only unsupported keywords no longer add a stray {[k: string]: unknown} to the intersection.
With inferStringEnumKeysFromValues enabled, const is emitted as a literal type again rather than a single-member enum.
This option no longer produces invalid enum members for non-string, empty, or digit-leading values.
Nested array bounds are capped by their cumulative product against maxItems, falling back to an unbounded array rather than hanging or emitting enormous tuple unions.
OpenAPI 3.0 schemas with nullable: true, including those next to a $ref, now emit T | null.
Nested properties and patternProperties are now intersected with compound types instead of being dropped.
Multiple patternProperties, including with additionalProperties: false, are folded into one index signature typed as the union of their value types.
Index signatures from patternProperties or additionalProperties are widened to cover sibling named properties so the interface typechecks.
Recursive schemas reaching the generator without a name receive a generated type name instead of overflowing the stack.
Draft-07 named-anchor references matching a sibling $id are resolved instead of crashing.
References to definitions with dotted names now use the full name rather than truncating at the first dot.
A root-level reference to a definition that is itself only a reference no longer crashes.
Root-level references to definitions that refer back to themselves compile instead of crashing; the referenced definition remains emitted alongside the root type.
Piping a schema on stdin no longer prints a DEP0187 deprecation warning on Node 24.