Releases: mnahkies/openapi-code-generator
v0.21.0
What's Changed
This is a bigger than normal release, and contains a number of potentially breaking changes - however in general, these are making it clearer when the code generator doesn't support something properly (eg: it was probably already broken).
The primary changes are:
- Unsupported
Content-Type
will now generatenever
as their typescript type - HTML form data submissions (
application/x-www-form-urlencoded
) are now supported text/plain
request bodies are also now supported- The CLI will auto-detect your formatter (biome/prettier) config and then use that config / formatter during code generation
- Boolean schemas can now include an
enum
to restrict them to literaltrue
orfalse
- Server urls now allow "required" variables/placeholders
As well as several minor bug fixes, and maintenance chores. Most notably switching to pnpm
which will hopefully help prevent issues with missing dependencies or misaligned peer dependencies in future.
Features
- feat: allow mandatory server variables by @mnahkies in #341
- feat: read formatter config by @mnahkies in #343
- feat: support text/plain request bodies by @mnahkies in #350
- feat: boolean schemas support enum by @mnahkies in #351
- feat: support application/x-www-form-urlencoded request bodies by @mnahkies in #352
Bug Fixes
- fix: adjust typing to reflect that boolean request headers are supported by @mnahkies in #339
- fix: partial koa-body middlware options by @mnahkies in #346
- fix: filter invalid request bodies by @mnahkies in #348
- chore: switch to pnpm and fix peer dependencies by @mnahkies in #345
- fix: improve request body / content-type handling by @mnahkies in #349
- fix: serialize scim json bodies by @mnahkies in #355
Misc
- chore(deps): update all dependencies by @renovate[bot] in #338
- fix(ci): adjust workflow permissions by @mnahkies in #340
- chore: upgrade deps / refresh data by @mnahkies in #342
- chore: adjust webpack config to allow node: protocol imports by @mnahkies in #344
- chore: upgrade biome to v2 by @mnahkies in #347
- chore: generate.mjs supports filtering by template/spec by @mnahkies in #353
- fix: check validator works by @mnahkies in #354
- chore: refresh deps / data by @mnahkies in #356
- docs: update compatibility by @mnahkies in #357
Full Changelog: v0.20.1...v0.21.0
v0.20.1
What's Changed
This is a bug fix release that fixes some edge cases and adds compatibility with NodeJS v24.
Bug fixes
- fix: array schema output order by @mnahkies in #329
- fix: error if route placeholder present without matching path parameter by @mnahkies in #331
- fix: fetch proxy compatible with node 24 by @mnahkies in #333
Misc
- refactor: tidy up dependency-graph by @mnahkies in #335
- docs: per page descriptions by @mnahkies in #328
- chore: node v24 / update deps by @mnahkies in #332
- chore: refresh data by @mnahkies in #334
- ci: publish docs on tag push by @mnahkies in #336
- fix: bump engines by @mnahkies in #337
Full Changelog: v0.20.0...v0.20.1
v0.20.0
What's Changed
The main feature in this release is a new typescript-express
server generation template. Its very similar in function to the typescript-koa
template, but allows use of the express middleware ecosystem.
See the documentation here: https://openapi-code-generator.nahkies.co.nz/guides/server-templates/typescript-express
There was also some improvements of the availability of "escape hatches", namely you can now return a SkipResponse
symbol to bypass the normal response validation and sending, allowing your handler full control over this.
Features
- feat: typescript-express server template by @mnahkies in #324
- feat: improve escape hatches by @mnahkies in #326
Bug Fixes
- fix: don't export aliases if name is ApiClient by @mnahkies in #319
- fix: wrap response validation errors when using joi by @mnahkies in #323
Misc
- refactor: decompose koa server generator by @mnahkies in #316
- chore(deps): update all dependencies by @renovate in #317
- ci: cache .next/cache by @mnahkies in #318
- chore: mark specification validation as generated by @mnahkies in #321
- chore: adopt typescript project references by @mnahkies in #322
- fix: parametrize responder generation by @mnahkies in #325
- fix: clean tsconfig.tsbuildinfo by @mnahkies in #327
Full Changelog: v0.19.2...v0.20.0
v0.19.2
v0.19.1
v0.19.0
What's Changed
The headline feature, and potentially breaking change, is safer enum evolution. You can read more about it on the documentation site here: https://openapi-code-generator.nahkies.co.nz/guides/concepts/enums
Otherwise included some minor bug fixes to joi
schema generation, and misc testing improvements.
Features
Bug fixes
- fix: typescript is a production dependency by @mnahkies in #299
- fix: joi array query params by @mnahkies in #309
Docs
- feat: add an interactive playground to the documentation site by @mnahkies in #216
- feat(docs): upgrade to nextra 4 by @mnahkies in #301
Misc
- chore: refresh deps / data by @mnahkies in #294
- chore(deps): update all dependencies by @renovate in #293
- chore(deps): update dependency koa to v2.15.4 [security] by @renovate in #296
- chore(deps): update dependency axios to v1.8.2 [security] by @renovate in #300
- chore: deps / refresh data by @mnahkies in #302
- chore(deps): update all dependencies by @renovate in #295
- chore(deps): update dependency next to v15.2.3 [security] by @renovate in #303
- chore(deps): update dependency next to v15.2.4 [security] by @renovate in #305
- chore(deps): update all dependencies by @renovate in #304
- refactor: normalizeSchemaObject is a instance method of input by @mnahkies in #306
- fix: paths to openapi specifications by @mnahkies in #307
- chore(deps): update dependency koa to v2.16.1 [security] by @renovate in #308
- chore: upgrade dependencies and roadmap by @mnahkies in #312
Full Changelog: v0.18.0...v0.19.0
v0.18.0
What's Changed
Primarily a bug-fix release focusing on improving client SDK runtime validation.
POTENTIALLY BREAKING CHANGES
- Users of
joi
validation must change the dependency from@hapi/joi
tojoi
- Unused
Res
andStatusCode
types removed fromtypescript-axios-runtime
package TypedFetchResponse
removed fromtypescript-fetch-runtime
package, use exported typeRes
instead if needed
Bug fixes
- feat(typescript-fetch)!: simplify response types by @mnahkies in #280
- fix(typescript-axios)!: remove unused exports by @mnahkies in #281
- fix(joi)!: switch from @hapi/joi to joi by @mnahkies in #284
- fix: intersected union schemas by @mnahkies in #283
- fix(typescript-fetch): runtime validation works by @mnahkies in #287
- fix(client-sdks): handle 204 empty responses with runtime validation by @mnahkies in #288
Misc
- chore: refresh / update deps by @mnahkies in #289
- test: add missing unit tests to utils by @mnahkies in #292
- docs: regenerate release-notes by @mnahkies in #279
Full Changelog: v0.17.0...v0.18.0
v0.17.0
What's Changed
The main change is that server
overrides at the path / operation level will now be respected and create an additional positional parameter for these methods when generating clients (closes #266).
There was also a fix for client generation with --enable-runtime-response-validation
, when the typescript project has exactOptionalPropertyTypes: true
in its tsconfig.json
Additionally defaultHeaders
is now optional in client configuration, and the HTTP head
verb is now supported. The documentation got a few new pages including a roadmap, and some general tips on usage.
BREAKING CHANGES
- New positional parameter on methods where server overrides are included in the specification
- Unique export names for Angular services now suffixed with
Service
Features
- feat: support servers at path / operation level + variables by @mnahkies in #272
- feat: defaultHeaders is optional by @mnahkies in #274
- feat: support http verb 'head' by @mnahkies in #271
Bug Fixes
- fix: support exactOptionalPropertyTypes on client SDKs by @mnahkies in #278
- fix!: angular modules have unique export names by @mnahkies in #270
Docs
- docs: add tips page by @mnahkies in #275
- docs: use with react-query by @mnahkies in #276
- docs: add roadmap / release notes by @mnahkies in #277
- docs: iterate on the documentation by @mnahkies in #268
Misc
- chore: dependencies by @mnahkies in #273
- chore(deps): update all dependencies by @renovate in #269
- chore: dependencies / refresh data by @mnahkies in #267
Full Changelog: v0.16.0...v0.17.0
v0.16.0
What's Changed
Client class exports will now be given unique names generated from the input specifications info.title
field. This can additionally be overridden through a new cli arg --override-specification-title
.
The previous generic exports are kept for backwards compatibility.
POTENTIALLY BREAKING: Filenames generated from tags or route prefixes will now follow kebab-case
naming convention by default. This can be customized to other conventions like camel-case
, etc using --filename-convention
Features
- feat: unique client export names by @mnahkies in #263
- feat!: dynamic filename conventions / no spaces in filenames by @mnahkies in #259
- feat: safer identifier transformation by @mnahkies in #260
Misc
- fix: format/emit in parallel by @mnahkies in #265
- chore: upgrade to next@15 by @mnahkies in #261
- chore(deps): update all dependencies by @renovate in #262
- chore: refresh data + regenerate by @mnahkies in #264
Full Changelog: v0.15.0...v0.16.0
v0.15.0
What's Changed
It's now possible to change the construct used for the "implementation" symbol between being a type
, interface
or abstract class
using the new option --ts-server-implementation-method
. This is particularly useful if using a dependency injection library that requires abstract class
as part of its wiring approach.
Additionally, when splitting the generated files by first-tag
/ first-slug
(using --grouping-strategy
), the tag/slug will now be added to the exported symbol names, eg: createRouter
-> createMyTagRouter
and Implementation
-> MyTagImplementation
. This can reduce the need to alias imports manually.
The generic Implementation
/ createRouter
exports have be retained to keep this backwards compatible.
Features
- feat: support emitting abstract classes for implementation types by @mnahkies in #256
- feat: emit unique symbol names for Implementation / createRouter functions by @mnahkies in #258
Misc
- fix(docs): improve meta tags by @mnahkies in #255
- chore: dependencies / refresh data by @mnahkies in #257
Full Changelog: v0.14.0...v0.15.0