unstale

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 init

@unstale/cli on npm

openapi-typescript 728 changes

Breaking changes 16

  • The --support-array-length flag was renamed to --array-length.

    7.0.0release notes

  • The CLI flag was removed; configure auth options in redocly.yaml instead.

    7.0.0release notes

  • defaultNonNullable now defaults to true; set it to false to restore the previous behavior.

    7.0.0release notes

  • Schemas no longer export external; schema content is flattened into the components object.

    7.0.0release notes

  • The Node.js-only fetch option was removed from the Node.js API; the fetch client can be set in redocly.yaml.

    7.0.0release notes

  • The CLI flag was removed; use redocly.yaml configuration instead.

    7.0.0release notes

  • The --immutable-types flag was renamed to --immutable.

    7.0.0release notes

  • TypeScript enums are no longer marked readonly when the --immutable option is used.

    7.0.0release notes

  • The main Node.js API now returns a TypeScript AST instead of strings, allowing access to generated-code properties such as comments.

    7.0.0release notes

  • The # character in operation IDs is replaced with a slash.

    7.0.0release notes

  • Most optional objects are now always present in generated types, typed as never when absent.

    7.0.0release notes

  • The postTransform callback now returns TypeScript AST nodes instead of strings.

    7.0.0release notes

  • Schema globbing was removed; specify multiple schemas with outputs in redocly.yaml instead.

    7.0.0release notes

  • Schemas are automatically validated with Redocly CLI, which throws on actual schema errors by default.

    7.0.0release notes

  • The transform callback now returns TypeScript AST nodes instead of strings.

    7.0.0release notes

  • TypeScript is now a peer dependency and must be installed alongside openapi-typescript.

    7.0.0release notes

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.

    7.13.0release notes

  • A flag was added to keep casing for exported root types.

    7.12.0release notes

  • Schemas can be configured via the apis key in redocly.config.yaml, and Redocly config options are respected.

    7.0.0release notes

  • The enum option exports top-level enums from schemas.

    7.0.0release notes

  • formatOptions allows formatting TypeScript output.

    7.0.0release notes

  • Support was added for the x-enum-descriptions schema extension.

    7.0.0release notes

  • Support was added for the x-enum-varnames schema extension.

    7.0.0release notes

Behavior and default changes 1

  • Header responses now include a string index type for additional untyped headers.

    7.0.0release notes

Tooling 2

  • A debugger was added to profile performance and show more in-depth messages.

    7.0.0release notes

  • Schemas can now be bundled with Redocly CLI.

    7.0.0release notes

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.

    7.12.0release notes

  • Fixes handling of multi-line JSDoc comments.

    7.10.1release notes

openapi-typescript 619 changes

Breaking changes 10

  • The -ap CLI alias is dropped; use --additional-properties instead.

    6.0.0release notes

  • The flag is dropped because returning never for empty content is now the default.

    6.0.0release notes

  • Empty content {} now returns never by default.

    6.0.0release notes

  • The package now ships modern ESNext code rather than ES2018.

    6.0.0release notes

  • The Node API's formatter() function is renamed and upgraded to transform() and postTransform().

    6.0.0release notes

  • Prettier formatting and all formatting options are dropped; format generated output at your discretion.

    6.0.0release notes

  • The -it CLI alias is dropped; use --immutable-types instead.

    6.0.0release notes

  • The flag is dropped because it was incompatible with --path-params-as-types.

    6.0.0release notes

  • Node 14 support is dropped; it may still work, but Node 14 bugs will not be fixed.

    6.0.0release notes

  • Support for Swagger 2.0 is dropped.

    6.0.0release notes

New APIs and options 3

  • The --immutable-types option gains a -t alias.

    6.0.0release notes

  • Types are added for path.default.

    6.0.0release notes

  • A new hook gives you more control in overriding or extending generated types.

    6.0.0release notes

Performance 1

  • Type generation is about 3× faster after dropping Prettier and optimizing deep-object crawl speed.

    6.0.0release notes

Behavior and default changes 1

  • The flag now returns the version of this library.

    6.0.0release notes

Tooling 1

  • OpenAPI 3.1 support now covers discriminator and polymorphic types.

    6.0.0release notes

Fixes and other changes 3