NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #4542 most downloaded on npm
Convert OpenAPI 3.0 & 3.1 schemas to TypeScript
Latest stable
7.13.0
Last release 9 months ago
11 Feb 2026
Release timing varies
gaps range from 2 weeks to 4 months
Nearly every release is documented
notes for 58 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
156 releases · first in 2020
Drag across the ruler to compare, or tap a release to open it.
### Minor Changes - #2549 `a690e52` Thanks @abumalick! - Add readOnly/writeOnly support via --read-write-markers flag. When enabled, readOnly properti
a690e52 Thanks @abumalick! - Add readOnly/writeOnly support via --read-write-markers flag. When enabled, readOnly properties are wrapped with $Read<T> and writeOnly properties with $Write<T>. openapi-fetch uses Readable<T> and Writable<T> helpers to exclude these properties from responses and request bodies respectively.### Minor Changes - #2524 `697f7fe` Thanks @gunnarvelle! - Added flag to keep casing for exported root types ### Patch Changes - #2536 `e3c05a4` Thank
697f7fe Thanks @gunnarvelle! - Added flag to keep casing for exported root typese3c05a4 Thanks @darkbasic! - Fix enumValues: true output for schemas that use oneOf/anyOf unions by narrowing union types with Extract<> before accessing variant-specific properties. This prevents invalid type paths when an accessed property only exists on some union members.Your coding agent can read these notes before it upgrades. Set up the MCP server →
### Patch Changes - #2480 `e04dc65` Thanks @MatissJanis! - Fix multi-line jsdoc comments
e04dc65 Thanks @MatissJanis! - Fix multi-line jsdoc comments### Minor Changes - #2449 `bdd5ddb` Thanks @kristianjf! - Add transformProperty hook for property signature modification - #2288 `0f22be2` Thanks @hon
### Patch Changes - #2393 `6943ccf` Thanks @simon-curtis! - Now checking for null & empty string when generating enum description - #2375 `5be22d7` Th
### Minor Changes - #2374 `c5ebbb8` Thanks @cmlee-accelins! - Add JSDoc support for the recommended examples array on JSON Schema objects.
c5ebbb8 Thanks @cmlee-accelins! - Add JSDoc support for the recommended examples array on JSON Schema objects.### Minor Changes - #2310 `e66b5ce` Thanks @drwpow! - Build package with unbuild to improve CJS support
### Patch Changes - #2185 `67889ba` Thanks @duncanbeevers! - Fix invalid $ref index into path
67889ba Thanks @duncanbeevers! - Fix invalid $ref index into path### Patch Changes - #2145 `d79efae` Thanks @luhn! - Don't remove null type if a default is present.
### Patch Changes - #2260 `7205e12` Thanks @zrosenbauer! - Prevents a TypeError due to a bad in operator for type: "array" when a boolean is set on it
7205e12 Thanks @zrosenbauer! - Prevents a TypeError due to a bad in operator for type: "array" when a boolean is set on items### Minor Changes - #2249 `7f3f7b6` Thanks @gzm0! - Add jsdoc comments to response object ### Patch Changes - #2199 `fc3f7f8` Thanks @StefanTerdell! -
#2199 fc3f7f8 Thanks @StefanTerdell! - Fix boolean object property schemas
#2152 47e4b5e Thanks @insertmike! - - Fixed --make-paths-enum option transforming the paths URL (:id instead of {id})
#2241 ef23947 Thanks @stanleyk! - Replacing any with unknown in the ReadonlyArray type declaration.
### Patch Changes - #2131 `41bed98` Thanks @htunnicliff! - Update @redocly/openapi-core to fix punycode deprecation bug
41bed98 Thanks @htunnicliff! - Update @redocly/openapi-core to fix punycode deprecation bug### Minor Changes - #2102 `0cdfc47` Thanks @ViktorPontinen! - Support generating path params for flaky schemas using --generate-path-params option
0cdfc47 Thanks @ViktorPontinen! - Support generating path params for flaky schemas using --generate-path-params option### Patch Changes - #2085 `2bffe2a` Thanks @drwpow! - Update @redocly/openapi-core to 1.27.0
### Patch Changes - #2049 `39f9b2f` Thanks @duncanbeevers! - Add schema to postTransform options
39f9b2f Thanks @duncanbeevers! - Add schema to postTransform options### Minor Changes - #2052 `d2de5c7` Thanks @laurenz-glueck! - brings back --make-paths-enum option to generate ApiPaths enum - #2059 `9e4f61c` Thanks
#2052 d2de5c7 Thanks @laurenz-glueck! - brings back --make-paths-enum option to generate ApiPaths enum
#2059 9e4f61c Thanks @gduliscouet-ubitransport! - Allow all types except UNKNOWN to be nullable
### Patch Changes - #1999 `e2d8541` Thanks @patzick! - Improved error messages to contain locations.
### Patch Changes - #1982 `8d00218` Thanks @prewk! - Make pathParamsAsTypes work with integer/boolean types
### Patch Changes - #1873 `c2c396d` Thanks @DanDeMicco! - Support for generating enums when enums definition has null value
c2c396d Thanks @DanDeMicco! - Support for generating enums when enums definition has null value### Patch Changes - #1917 `4a59124` Thanks @drwpow! - Bump Redocly Core
### Minor Changes - #1876 `a9cd9aa` Thanks @BradHacker! - Add option to export all root component types
a9cd9aa Thanks @BradHacker! - Add option to export all root component types### Patch Changes - #1877 `94592a4` Thanks @phk422! - fix: replace special characters using SPECIAL_CHARACTER_MAP for duplicate-identifiers
### Patch Changes - #1867 `21fb8b0` Thanks @phk422! - fix(openapi-typescript): type errors generated under enumValues
### Patch Changes - #1849 `08bde72` Thanks @liangskyli! - fix: keyedParameters use unique key
08bde72 Thanks @liangskyli! - fix: keyedParameters use unique key### Minor Changes - #1799 `9939b76` Thanks @drwpow! - Don’t generate | undefined for additionalProperties
### Minor Changes - #1775 `b1bbe62` Thanks @phk422! - feat: add dedupeEnums option
### Patch Changes - #1717 `335530c` Thanks @kerwanp! - Ignore configuration files in published package
### Patch Changes - #1784 `c2f8655` Thanks @yoshi2no! - Fix: Correct handling of identical minItems and maxItems in array schemas when arrayLength opt
### Minor Changes - #1766 `0ce35d7` Thanks @phk422! - feat: Add the inject option - #1768 `285b097` Thanks @phk422! - feat: Add check option ### Patch
#1772 41cb9a2 Thanks @ashwin153! - fix: add explicit import of performance to fix bazel compatibility issues
#1764 2793049 Thanks @michalfedyna! - Fix --properties-required-by-default flag not working
#1763 19b9383 Thanks @nkt! - fix: schema.content might be omitted
### Patch Changes - #1746 `e705909` Thanks @phk422! - fix: Correct handling of default parameter values in referenced component schema
### Patch Changes - #1761 `8043c5d` Thanks @yoshi2no! - fix: Enum option cannot generate enums if values are not valid property names
### Patch Changes - #1743 `8f6ec20` Thanks @avaly! - Generate valid types for referenced nested properties
### Patch Changes - #1724 `f47268f` Thanks @simensol! - Make sure result is an object before using the in operator.
`6d1eb32` Thanks @drwpow! - ⚠️ Breaking: The Node.js API now returns the TypeScript AST for the main method as well as transform() and postTransform()
6d1eb32 Thanks @drwpow! - ⚠️ Breaking: The Node.js API now returns the TypeScript AST for the main method as well as transform() and postTransform(). To migrate, you’ll have to use the typescript compiler API:
+ import ts from "typescript";
+ const DATE = ts.factory.createIdentifier("Date");
+ const NULL = ts.factory.createLiteralTypeNode(ts.factory.createNull());
const ast = await openapiTS(mySchema, {
transform(schemaObject, metadata) {
if (schemaObject.format === "date-time") {
- return schemaObject.nullable ? "Date | null" : "Date";
+ return schemaObject.nullable
+ ? ts.factory.createUnionTypeNode([DATE, NULL])
+ : DATE;
}
},
};
Though it’s more verbose, it’s also more powerful, as now you have access to additional properties of the generated code you didn’t before (such as injecting comments).
For example syntax, search this codebae to see how the TypeScript AST is used.
Also see AST Explorer’s typescript parser to inspect how TypeScript is interpreted as an AST.
6d1eb32 Thanks @drwpow! - ⚠️ Breaking: Changing of several CLI flags and Node.js API options
--auth, --httpHeaders, --httpMethod, and fetch (Node.js-only) options were all removed from the CLI and Node.js API
--immutable-types has been renamed to --immutable--support-array-length has been renamed to --array-lengthfbaf96d Thanks @drwpow! - ⚠️ Breaking: Remove globbing schemas in favor of redocly.yaml config. Specify multiple schemas with outputs in there instead. See Multiple schemas for more info.
6d1eb32 Thanks @drwpow! - ⚠️ Breaking: Most optional objects are now always present in types, just typed as :never. This includes keys of the Components Object as well as HTTP methods.
6d1eb32 Thanks @drwpow! - ⚠️ Breaking: No more external export in schemas anymore. Everything gets flattened into the components object instead (if referencing a schema object from a remote partial, note it may have had a minor name change to avoid conflict).
6d1eb32 Thanks @drwpow! - ⚠️ Breaking defaultNonNullable option now defaults to true. You’ll now need to manually set false to return to old behavior.
799194d Thanks @drwpow~ - ⚠️ Breaking TypeScript is now a peerDependency and must be installed alongside openapi-typescript
6d1eb32 Thanks @drwpow! - ✨ Feature: automatically validate schemas with Redocly CLI (docs). No more need for external tools to report errors! 🎉
312b7ba Thanks @drwpow! - ✨ Feature: allow configuration of schemas via apis key in redocly.config.yaml. See docs for more info.
6d1eb32 Thanks @drwpow! - ✨ Feature: add enum option to export top-level enums from schemas
6d1eb32 Thanks @drwpow! - ✨ Feature: add formatOptions to allow formatting TS output
6d1eb32 Thanks @drwpow! - ✨ Feature: header responses add [key: string]: unknown index type to allow for additional untyped headers
6d1eb32 Thanks @drwpow! - ✨ Feature: bundle schemas with Redocly CLI
6d1eb32 Thanks @drwpow! - ✨ Feature: Added debugger that lets you profile performance and see more in-depth messages
#1374 7ac5174 Thanks @ElForastero! - Add support for x-enum-varnames and x-enum-descriptions
#1545 9158b81 Thanks @jaredLunde! - Replace # characters in operation IDs with a slash
Nothing published for this version
Patches security vulnerability with node-fetch (by replacing with undici)
6d1eb32 Thanks @drwpow! - ⚠️ Breaking: The Node.js API now returns the TypeScript AST for the main method as well as transform() and postTransform(). To migrate, you’ll have to use the typescript compiler API:
+ import ts from "typescript";
+ const DATE = ts.factory.createIdentifier("Date");
+ const NULL = ts.factory.createLiteralTypeNode(ts.factory.createNull());
const ast = await openapiTS(mySchema, {
transform(schemaObject, metadata) {
if (schemaObject.format === "date-time") {
- return schemaObject.nullable ? "Date | null" : "Date";
+ return schemaObject.nullable
+ ? ts.factory.createUnionTypeNode([DATE, NULL])
+ : DATE;
}
},
};
Though it’s more verbose, it’s also more powerful, as now you have access to additional properties of the generated code you didn’t before (such as injecting comments).
For example syntax, search this codebae to see how the TypeScript AST is used.
Also see AST Explorer’s typescript parser to inspect how TypeScript is interpreted as an AST.
6d1eb32 Thanks @drwpow! - ⚠️ Breaking: Changing of several CLI flags and Node.js API options
--auth, --httpHeaders, --httpMethod, and fetch (Node.js-only) options were all removed from the CLI and Node.js API
--immutable-types has been renamed to --immutable--support-array-length has been renamed to --array-lengthfbaf96d Thanks @drwpow! - ⚠️ Breaking: Remove globbing schemas in favor of redocly.yaml config. Specify multiple schemas with outputs in there instead. See Multiple schemas for more info.
6d1eb32 Thanks @drwpow! - ⚠️ Breaking: Most optional objects are now always present in types, just typed as :never. This includes keys of the Components Object as well as HTTP methods.
6d1eb32 Thanks @drwpow! - ⚠️ Breaking: No more external export in schemas anymore. Everything gets flattened into the components object instead (if referencing a schema object from a remote partial, note it may have had a minor name change to avoid conflict).
6d1eb32 Thanks @drwpow! - ⚠️ Breaking defaultNonNullable option now defaults to true. You’ll now need to manually set false to return to old behavior.
799194d Thanks @drwpow~ - ⚠️ Breaking TypeScript is now a peerDependency and must be installed alongside openapi-typescript
6d1eb32 Thanks @drwpow! - ✨ Feature: automatically validate schemas with Redocly CLI (docs). No more need for external tools to report errors! 🎉
312b7ba Thanks @drwpow! - ✨ Feature: allow configuration of schemas via apis key in redocly.config.yaml. See docs for more info.
6d1eb32 Thanks @drwpow! - ✨ Feature: add enum option to export top-level enums from schemas
6d1eb32 Thanks @drwpow! - ✨ Feature: add formatOptions to allow formatting TS output
6d1eb32 Thanks @drwpow! - ✨ Feature: header responses add [key: string]: unknown index type to allow for additional untyped headers
6d1eb32 Thanks @drwpow! - ✨ Feature: bundle schemas with Redocly CLI
6d1eb32 Thanks @drwpow! - ✨ Feature: Added debugger that lets you profile performance and see more in-depth messages
#1374 7ac5174 Thanks @ElForastero! - Add support for x-enum-varnames and x-enum-descriptions
#1545 9158b81 Thanks @jaredLunde! - Replace # characters in operation IDs with a slash
6d1eb32 Thanks @drwpow! - Refactor internals to use TypeScript AST rather than string mashing
6d1eb32 Thanks @drwpow! - 🧹 Cleaned up and reorganized all tests
#1602 9da96cd Thanks @JeanRemiDelteil! - Do not add readonly on Typescript enum when the --immutable option is used.
#1348 f6fdd2f Thanks @drwpow! - Improve YAML vs JSON parsing
#1345 6f078c1 Thanks @SchabaJo! - Mirror directory structure of input files if output is a directory to prevent overwriting the same file again and again.
7cb02ac Thanks @duncanbeevers! - Request parameters member is optional when all parameters are optional.3cf78b9 Thanks @duncanbeevers! - Wrap nested readonly types in parentheses, allowing for nested immutable arrays99a1648 Thanks @pvanagtmaal! - Avoid adding a undefined union to additionProperties#1280 50441d0 Thanks @pvanagtmaal! - Fix invalid typescript for empty request bodies, fix headers being left out when response body is omitted
#1289 7f452fa Thanks @adamschoenemann! - Fixed a bug where references to types with discriminators with implicit mappings would generate incorrect types
ebd31ff Thanks @pvanagtmaal! - Refactor CLI path handling, fixing several bugsd7420e3 Thanks @pvanagtmaal! - Fix externalizing external refse735ff2 Thanks @pimveldhuisen! - Stop trimming whitespace other than linebreaks in string values#1248 c145f5f Thanks @drwpow! - Fix Record<string, never> appearing in union
#1248 c145f5f Thanks @drwpow! - Improve oneOf generated types
#1231 e1ce2d6 Thanks @tkrotoff! - Do not append trailing spaces to JSDoc tags
#1232 31c030d Thanks @tkrotoff! - Remove unnecessary array parenthesis
4fc8c20 Thanks @toomuchdesign! - Remove unexpected empty string in generated nullable polymophic enum types (["string", "null"])64decb7 Thanks @psychedelicious! - Add example for Blob type transformsdb37f3c Thanks @pvanagtmaal! - Fix property escaping for discriminators#1149 b82cffb Thanks @duncanbeevers! - Stringify const values with no specified type
#1156 ad017a9 Thanks @horaklukas! - Avoid index signature TS error for paths with empty params
--path-params-as-types (#1130). Thanks, barakalon!$refs to complete schemas (#1087)unknown by @mitchell-merry (#1049)$ref’d parameters missing (#1061)oneOf number const (#1056) by @qnp--empty-objects-unknown flag for better control over unspecified object types’ default shape by @duncanbeevers (#1032)webhook typings by @yacinehmito (#1001)fetch() instead of request() which can be overridden locally by @yacinehmito (#1002)nullable: true (#983)additionalProperties bug (#983)#/components/examples were being parsed as schema objectspostinstall hook only meant for dev--version was changed to return the version of this library (also by dropping Swagger 2.0 support the old usage was no longer needed)--raw-schema. Your entry schema MUST be valid and complete (however, your $refs to subschemas may be partials).--make-paths-enum because it was incompatible with --path-params-as-types-it and -ap (specify the full --immutable-types or --additional-properties flag){} now returns never. Dropped the --content-never flag as this is now the default behavior.formatter() function to transform() and postTransform(). It’s an overall improvement on the original concept with even more power than before.discriminator and polymorphic typestransform() and postTransform() hooks give you more control in overriding/extending generated typesoneOf / anyOf / allOf (#894)--immutable-types has a new -t aliasnullable as type arrays for OpenAPI 3.1 (#898)$refsanyOf intersections resulting in unexpected type signatures[string, null] generating as unknown{ property: unknown; } with allOf unionrequestBody missing content property$refs--content-never flag forces never response body by @duncanbeevers (#905)@default by @duncanbeevers (#906)--prettier-config path by @duncanbeevers (#909)@default by @duncanbeevers (#910)enum export of operation paths by @duncanbeevers (#912)--make-paths-enum CLI flag by @berzi (#883)--path-params-as-types CLI flag by @Powell-v2 (#891)/** @constant */ JSDoc comments by @PhilipTrauner (#896)--export-type flag was added to generate type instead of interface by @dominikdosoudil (#868)openapi-typescript@4). Version 5 switched to ESM as default anyway, and since tests are now testing ESM, the reliability of CJS was dubious (and there were TypeScript problems as well)oneOf by @sadfsdfdsa (#830)URL() as input to make ESM usage easier (see example)@deprecated comment to deprecated schema objects by @bunksceneany with unknown (#769). See #554 for more explanation / context{ [key: string]: unknown } for a type when it may have been a string or number. Now it will generate a more generic unknown type, unless it knows it’s dealing with an object for sure.properties key by @Peteck (#626)--headersObject and --headers CLI flags by @ericzorn93 (#764)"type": "file" no longer generates unexpected results (#766)$refs (#689)properties + anyOf with only required properties by @gr2m (#643)$ref: "remote.yaml#/components/schemas/User) 🎉 (#602)!--default-non-nullable flag (#631)default: property shouldn’t be marked as nullable (#613)--additional-properties flag (#607)-c shortcut alias for --prettier-config (#607)-it shortcut alias for --immutable-types (#607)additionalProperties now default to true per the OpenAPI 3.0 spec by @mehalter (#583)enum: [] (#563)options.prettierConfig (#566)--immutable-types flag by @dnalborczyk (#522)operations interface inherits parameters properly by @henhal (#530)--auth flag to access private schemas (#508)definitions, an unexpected error was encountered. This is now fixed.oneOf by @gr2m (#491)$ref and operationId generated invalid TypeScript (#464)3.0.0 with no problems; OpenAPI v3 users will either experience no changes or minor changes that should be an overall improvement.additionalProperties.oneOf is now generating as expected (#442)paths.requestBody.content possibly missing by @robertmassaioli (#369)operations interface by @gr2m (#353)$ref: 'foo.yaml#bar' syntax, but cast to any type (TODO: full external schema support) (#354)$refs in paths now respect optional parameters (#352) by @gr2mrequestBody and $ref-type parameters added in response types by @gr2m🐣 Minor Changes
any to never or unknown by @gr2mopenapi-typescript.UserRole is now definitions['user']['role']). See README for migration instructions. (#223)1.x were dropped and no longer work (#223)@ character in namespaces thanks to @sorin-davidoi 🎉2.0--swagger flag is now deprecated; this library will automatically parse the version from the schema.additionalProperties weren’t respected for nested properties (#92).--camelcase wouldn’t camelCase $refs properlytype would be skipped, rather than assume it’s an object like Swagger does by default.x-nullable and other properties by @atlefren (#118)--nowrapper flag was added to the CLI, courtesy of @scvnathan (#33). Now you don’t have to wrap your interfaces if you don’t want to!kebab-case would break generation unless they were converted to --camelcase (#13). This has been fixed! 🎉 You still have the option of converting to --camelcase, but now you can keep kebab-case too if needed--wrapper option, letting you specify any namespace or module wrapper for exporting types. See the README for full description--namespace and --export options are now deprecated, in favor of the more versatile --wrapper--export option to export namespaces thanks to @tpdewolfsnake_case properties (you can still convert with --camelcase)object if it can’t grab propertiesnamespace as 2nd parameter. Because namespacing is good.Error it would break your build if another type extended from itNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
### Patch Changes - #1648 `37885c2aec15d406720c5457da5bcaf7a142ab75` Thanks @nzapponi! - Fix SecurityRequirementsObject to allow partial security sche
37885c2aec15d406720c5457da5bcaf7a142ab75 Thanks @nzapponi! - Fix SecurityRequirementsObject to allow partial security schemes### Patch Changes - #1535 `48ca069fd889acd469955589ff3ec74e775ca9fd` Thanks @tvanier! - Support single operation parameter - #1524 `fe6c6d1526c59e4f90
#1535 48ca069fd889acd469955589ff3ec74e775ca9fd Thanks @tvanier! - Support single operation parameter
#1524 fe6c6d1526c59e4f9021d71cad74feba315f337f Thanks @WickyNilliams! - Keep type information for nullable fields when possible
### Patch Changes - #1509 `747611bcd0d056d5027841f985aed0aefcf6b63d` Thanks @drwpow! - Fix missing params when they have same name, different location
747611bcd0d056d5027841f985aed0aefcf6b63d Thanks @drwpow! - Fix missing params when they have same name, different location### Patch Changes - #1485 `0a100af72f103aad02be76ca3b8fce318524c1b5` Thanks @drwpow! - Remove prepare npm-scripts
0a100af72f103aad02be76ca3b8fce318524c1b5 Thanks @drwpow! - Remove prepare npm-scripts### Patch Changes - #1468 `43ccec8` Thanks @davidleger95! - Correctly transform untyped nullable fields to unknown
43ccec8 Thanks @davidleger95! - Correctly transform untyped nullable fields to unknownNothing published for this version
### Minor Changes - #1355 `7568941` Thanks @drwpow! - Revert optional parameters breaking change (v6.6.0, #1335)
### Patch Changes - #1348 `f6fdd2f` Thanks @drwpow! - Improve YAML vs JSON parsing - #1352 `33b2c4f` Thanks @drwpow! - Fix all parameters optional - #
Nothing published for this version
### Patch Changes - #1342 `c17669d` Thanks @drwpow! - Fix discriminator propertyName inference
### Minor Changes - #1335 `7cb02ac` Thanks @duncanbeevers! - Request parameters member is optional when all parameters are optional.
7cb02ac Thanks @duncanbeevers! - Request parameters member is optional when all parameters are optional.### Patch Changes - #1332 `8e8ebfd` Thanks @drwpow! - Restore original .d.ts module-resolution behavior
One column per quarter.