Releases: openapi-ts/openapi-typescript
Releases · openapi-ts/openapi-typescript
v6.0.2
v6.0.1
v6.0.0
✨ New Features
- OpenAPI 3.1 support for
discriminator
and polymorphic types - New
transform()
andpostTransform()
hooks give you more control in overriding/extending generated types - Deep-linked remote schemas now work
--immutable-types
has a new-t
alias- Addition of
path.default
types
🚀 Improvements
- Sped up type generation by ~3× by dropping Prettier & optimizing deep-object crawl speed
- More accurate types for
oneOf
/anyOf
/allOf
(#894) - Now ships modern
ESNext
code rather thanES2018
- Codebase cleanup; improved internal types & documentation
- Test cleanup, now powered by Vitest
🐛 Bugfixes
🔨 Breaking Changes
- Dropped Prettier formatting and all formatting options. Now, simply format at your discretion (or not at all!)
- Dropped support for Swagger 2.0
- Dropped Node 14 support (it still works for now, but Node 14 bugs won’t be fixed if any arise)
--version
was changed to return the version of this library (also by dropping Swagger 2.0 support the old usage was no longer needed)- Dropped
--raw-schema
. Your entry schema MUST be valid and complete (however, your$refs
to subschemas may be partials). - Dropped
--make-paths-enum
because it was incompatible with--path-params-as-types
- Dropped the CLI aliases
-it
and-ap
(specify the full--immutable-types
or--additional-properties
flag) - Empty content:
{}
now returnsnever
. Dropped the--content-never
flag as this is now the default behavior. - Renamed and upgraded the Node API’s
formatter()
function totransform()
andpostTransform()
. It’s an overall improvement on the original concept with even more power than before.
v5.4.0
✨ New features
- New
--content-never
flag forcesnever
response body by @duncanbeevers (#905)
🐛 Bugfixes
- Empty strings are now allowed for properties like
@default
by @duncanbeevers (#906) - Throws friendlier error on bad
--prettier-config
path by @duncanbeevers (#909) - Objects are now allowed for properties like
@default
by @duncanbeevers (#910) - Fixes
enum
export of operation paths by @duncanbeevers (#912)
v5.3.0
✨ New features
- New
--make-paths-enum
CLI flag by @berzi (#883) - New
--path-params-as-types
CLI flag by @Powell-v2 (#891) - Supports
/** @constant */
JSDoc comments by @PhilipTrauner (#896) - You can now add your own custom comment header at the top of every generated doc (#904)
🐛 Bugfixes
- Fixes inconsistent comment title (#904)
v5.2.0
✨ New features
- The
--export-type
flag was added to generatetype
instead ofinterface
by @dominikdosoudil (#868)
🐛 Bugfixes
- Fixes CommonJS error for undici on older versions of Node
🐣 Minor changes
- Tiny optimizations for a little speed boost
- Updated schemas & examples
v5.1.1
- Removes CJS version from npm (to use CJS, use
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)
🐛 Bugfixes
- Fixes type error when using TypeScript nightly (#847)
- Patches security vulnerability with node-fetch (by replacing with undici)
v5.1.0
✨ New Features
- Adds constants support by @sadfsdfdsa (#831)
🐛 Bugfixes
- Fixes a syntax error caused by an empty
oneOf
by @sadfsdfdsa (#830)
v5.0.1
v5.0.0
🦍 Major changes
- Updates this library to full ESM! ✨ This is the future of JavaScript, and is now natively supported in Node 14+.
🐥 Minor changes
- Now supports a
URL()
as input to make ESM usage easier (see example)
- 5.x drops support for Node 12. If you’re still on Node 12, be sure to lock your version to 4.x.