npm / openapi-typescript
openapi-typescript
What changed in openapi-typescript 6 to 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
26 breaking10 new APIs and options1 performance2 behavior and defaults3 tooling5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initopenapi-typescript 728 changes
Breaking changes 16
The --support-array-length flag was renamed to --array-length.
The CLI flag was removed; configure auth options in redocly.yaml instead.
defaultNonNullable now defaults to true; set it to false to restore the previous behavior.
Schemas no longer export external; schema content is flattened into the components object.
The Node.js-only fetch option was removed from the Node.js API; the fetch client can be set in redocly.yaml.
The CLI flag was removed; use redocly.yaml configuration instead.
The --immutable-types flag was renamed to --immutable.
TypeScript enums are no longer marked readonly when the --immutable option is used.
The main Node.js API now returns a TypeScript AST instead of strings, allowing access to generated-code properties such as comments.
The # character in operation IDs is replaced with a slash.
Most optional objects are now always present in generated types, typed as never when absent.
The postTransform callback now returns TypeScript AST nodes instead of strings.
Schema globbing was removed; specify multiple schemas with outputs in redocly.yaml instead.
Schemas are automatically validated with Redocly CLI, which throws on actual schema errors by default.
The transform callback now returns TypeScript AST nodes instead of strings.
TypeScript is now a peer dependency and must be installed alongside openapi-typescript.
New APIs and options 7
Enables readOnly properties to be wrapped with $Read<T> and writeOnly properties with $Write<T>; openapi-fetch uses Readable<T> and Writable<T> helpers to exclude them from responses and request bodies.
A flag was added to keep casing for exported root types.
Schemas can be configured via the apis key in redocly.config.yaml, and Redocly config options are respected.
The enum option exports top-level enums from schemas.
formatOptions allows formatting TypeScript output.
Support was added for the x-enum-descriptions schema extension.
Support was added for the x-enum-varnames schema extension.
Behavior and default changes 1
Header responses now include a string index type for additional untyped headers.
Tooling 2
A debugger was added to profile performance and show more in-depth messages.
Schemas can now be bundled with Redocly CLI.
Fixes and other changes 2
Fixes output for schemas using oneOf/anyOf unions by narrowing union types with Extract<> before accessing variant-specific properties, preventing invalid type paths.
Fixes handling of multi-line JSDoc comments.
openapi-typescript 619 changes
Breaking changes 10
The
-apCLI alias is dropped; use--additional-propertiesinstead.The flag is dropped because returning
neverfor empty content is now the default.Empty content
{}now returnsneverby default.The package now ships modern
ESNextcode rather thanES2018.The Node API's
formatter()function is renamed and upgraded totransform()andpostTransform().Prettier formatting and all formatting options are dropped; format generated output at your discretion.
The
-itCLI alias is dropped; use--immutable-typesinstead.The flag is dropped because it was incompatible with
--path-params-as-types.Node 14 support is dropped; it may still work, but Node 14 bugs will not be fixed.
Support for Swagger 2.0 is dropped.
New APIs and options 3
The
--immutable-typesoption gains a-talias.Types are added for
path.default.A new hook gives you more control in overriding or extending generated types.
Performance 1
Type generation is about 3× faster after dropping Prettier and optimizing deep-object crawl speed.
Behavior and default changes 1
The flag now returns the version of this library.
Tooling 1
OpenAPI 3.1 support now covers discriminator and polymorphic types.
Fixes and other changes 3
Deep-linked remote schemas now work.
Types for
oneOf,anyOf, andallOfare more accurate.Remote schemas that contain local
$refs now work.