Releases: mnahkies/openapi-code-generator
v0.25.0
What's Changed
This is a relatively minor release, with the main feature being zod-v4 schemas may now use z.discriminatedUnion in some circumstances (#436).
We now also test against NodeJS v26, and migrated to vitest rather than jest as our test runner.
Full Changes
- feat: discriminated unions by @mnahkies in #436
- chore: pnpm v11, ci includes nodejs v26 by @mnahkies in #472
- chore: koa-body v8, zod v4 by @mnahkies in #473
- chore: switch from jest to vitest by @mnahkies in #474
- docs: minor improvements by @mnahkies in #475
- fix: use pnpm run / exec, update release notes, lint by @mnahkies in #476
- fix: use bin shim by @mnahkies in #477
Full Changelog: v0.24.0...v0.25.0
v0.24.0
What's changed
This is a relatively small release, mostly focused on a few notable bug fixes. Also contains some improvements to generated zod-v4 schemas.
🐛 Bug Fixes
Axios Client Default Timeout
(potentially breaking)
- Previously this was ignored (since forever apparently 😬)
- This meant that unless you passed an
axiosinstance that itself had a default timeout configured, theaxiosdefault of no timeout was used - Now the
defaultTimeoutvalue will be respected, overriding that of the passedaxiosinstance - #463
This may cause some request timeouts, if you previously had too low of a timeout. It may prevent seeming "hung" requests under certain network conditions that you may have previously experienced.
Browser compatibility for fetch / axios runtimes
- The previous v0.23.0 release inadvertently broke including the fetch / axios runtimes in eg: NextJS applications
- Now solved, with
tsdownconfiguration updated to prevent re-occurrence - #471
✨ Features
zod-v4schema generation now usesz.object({...foo.shape, ...bar.shape})ors_Foo.extend(z.object({...}))as appropriate, instead of the deprecatedmergefunction. According to the documentation this may bring some boost totsc/ language server performance (#468)- (potentially breaking)
zod-v4schema generation will now validateformat: dateandformat: timeusingz.iso.date()/z.iso.time()(#467) - (potentially breaking) enums with a single possible value will now be treated as closed by default / as a literal. This better fits the typical usage in discriminated union type schemas. (#466)
Full Changes
- chore: bump deps by @mnahkies in #462
- fix: axios client respects the defaultTimeout by @mnahkies in #463
- docs: add AGENTS.md / docs/architecture.md by @mnahkies in #464
- chore: reduce tsdown log verbosity and fail on warnings by @mnahkies in #465
- feat!: enum of 1 is a literal by @mnahkies in #466
- feat: support format: date / time by @mnahkies in #467
- chore: refresh data / deps by @mnahkies in #469
- test: add some more e2e query parameter assertions by @mnahkies in #470
- feat: zod v4 uses spread / extend by @mnahkies in #468
- fix: extranous runtime deps bundled by @mnahkies in #471
Full Changelog: v0.23.0...v0.24.0
v0.23.0
What's Changed
This is an unusually large release, containing major architectural improvements, enhanced query parameter handling, and support for binary data.
It also contains several breaking changes to improve the internal domain model and consistency of the generated code, that will unblock further enhancements.
🚨 Breaking Changes
- Migrated to tsdown for bundling, providing both ESM and CJS variants of runtime packages #452, #456
- This shouldn't be a breaking change, but its significant enough to be aware of it
- Runtime & Response Processing
- Renamed Response to Res in runtime packages to avoid conflicts with the global DOM Response object #405
- Removed deprecated exports that are no longer used in regenerated code #406
- Migration: Regenerate your code using the latest CLI and update any manual imports from runtime packages referencing Response
- Schema & Type Naming
- Refactored "virtual schema" generation. This improves support for OAS 3.1+ but results in changed names for some anonymous types #398
- Some indirection has been removed e.g., types that just pointed to other types are now unwrapped
- Migration: You may need to update manual type references in your project if they were using generated anonymous names
- Query Parameter Serialization
- Dropped qs dependency in favor of internal logic that strictly respects OpenAPI style and explode modifiers #381
koav3 and@koa/router@v15now the minimum requirement #442- Dropped broken
readOnlymodifier support #409
✨ Features
- Binary Data Support: Added support for
application/octet-streamin both request and response bodies #359 - Improved Records: Better handling of
additionalProperties, emittingRecord<string, T>oranyas appropriate #408, #402 - Middleware: Added support for mounting middleware on individual routers via an optional parameter to
createRouter#442 - Improved handling of
allOf,anyOf, andoneOf#410
🐛 Bug Fixes
- Fixed missing types when enum is defined without an explicit type #407
- Fixed handling of boolean values for exclusiveMaximum and exclusiveMinimum #386
- Fixed tsconfig loading when compilerOptions is missing #382
- The logger now correctly respects NO_COLOR and similar environment variables #414
- Client Fetch: Fixed type narrowing issues with default response types in the fetch runtime #443
- Koa Server: Fixed overlapping route matching by no longer calling next() after a route handler is executed #442
🧹 Chore & Internal Improvements
- Dependencies: Extensive dependency refreshes, including migrations to Angular v21, Next.js v16.1, and TypeScript v6
- Testing: Significant expansion of the test suite, including new unit tests for schema normalization and type building #387, #389, #412
- CI/CD: Dropped Node v20 from CI, improved integration test performance using tsgo #451, and enabled publint and attw for better package compatibility #454
- Refactors: Major internal reorganization of the Input class and schema providers to simplify the dependency graph and improve testability #388, #416, #420
- Introduced code sharing between the runtime packages #401
Full Changes
- fix: tsconfig loading when no compilerOptions by @mnahkies in #382
- chore(deps): update all dependencies by @renovate[bot] in #380
- chore(deps): update dependency js-yaml to v4.1.1 [security] by @renovate[bot] in #383
- chore: upgrade dependencies, integration tests use angular v21 by @mnahkies in #384
- refactor: allow narrowing IRParameter into more specific types by @mnahkies in #385
- test: add some missing unit tests by @mnahkies in #387
- refactor: split input into more testable classes by @mnahkies in #388
- test: backfill tests for schema normalization by @mnahkies in #389
- fix: use schema types rather than ir by @mnahkies in #390
- fix: remove an instance of double normalization by @mnahkies in #391
- chore(deps): update dependency @angular/common to v21.0.1 [security] by @renovate[bot] in #393
- chore(deps): update dependency body-parser to v2.2.1 [security] by @renovate[bot] in #392
- chore(deps): update dependency next to v15.5.7 [security] by @renovate[bot] in #394
- chore(deps): update dependency @angular/compiler to v21.0.2 [security] by @renovate[bot] in #395
- chore: bump deps, separate build:docs by @mnahkies in #397
- feat!: move virtual schemas by @mnahkies in #398
- fix: remove request body indirection by @mnahkies in #399
- fix: handle boolean exclusiveMaximum / exclusiveMinimum by @mnahkies in #386
- feat!: introduce a new common runtime by @mnahkies in #401
- fix: correctly output Record<string, unknown> when irrelevant properties present by @mnahkies in #402
- fix!: query param serialization/parsing by @mnahkies in #381
- chore: update biome by @mnahkies in #403
- chore: upgrade nextjs to 16.1.0 by @mnahkies in #404
- refactor!: move more response processing into runtime package by @mnahkies in #405
- chore!: drop deprecated export by @mnahkies in #406
- feat: support application/octet-stream (Blob) req/res bodies by @mnahkies in #359
- fix: handle missing type when enum is defined by @mnahkies in #407
- feat: improve Record / additionalProperties handling by @mnahkies in #408
- fix: drop broken readOnly modifier support by @mnahkies in #409
- fix: make custom jest reporter more agent friendly by @mnahkies in #411
- fix: improve handling of allOf / anyOf / oneOf by @mnahkies in #410
- test: improve type builder unit tests by @mnahkies in #412
- test: expand extractPlaceholders tests by @mnahkies in #413
- fix: logger disables color based on NO_COLOR / etc by @mnahkies in #414
- refactor: split input.ts into several files by @mnahkies in #416
- refactor: simplify dependency graph by @mnahkies in #417
- refactor: copy schema builder test suites into unit / integration files by @mnahkies in #418
- refactor: de-duplicate the split tests by @mnahkies in #419
- refactor: schema-builders use ISchemaProvider instead of Input by @mnahkies in #420
- chore(deps): update dependency @angular/compiler to v21.0.7 [security] by @renovate[bot] in #421
- chore(deps): update dependency @angular/core to v21.0.7 [security] by @renovate[bot] in #422
- chore(deps): update dependency next to v16.1.5 [security] by @renovate[bot] in #424
- chore(deps): update dependency lodash to v4.17.23 [security] by @renovate[bot] in #423
- chore: refresh dependencies by @mnahkies in #425
- fix: patch axios temporarily / bump version by @mnahkies in #427
- chore: refresh dependencies by @mnahkies in #429
- chore(deps): update dependency ajv to v8.18.0 [security] by @renovate[bot] in #428
- chore(deps): update dependency koa to v3.1.2 [security] by @renovate[bot] in #430
- chore(deps): update dependency @angular/core to v21.1.6 [security] by @renovate[bot] in #431
- chore: refresh deps by @mnahkies in #434
- chore: add pnpm run ci-pipeline:fast by @mnahkies in #441
- chore: refresh dependencies / typescript v6 by @mnahkies in #449
- fix(fetch): type narrowing with default response types by @mna...
v0.22.0
What's Changed
This is a pretty significant release, with two larger features:
- Support for Zod V4, whilst retaining support for Zod V3
- Support for projects using ESM, and use
import typewhere possible
Aside from this, we've made efforts to improve supply chain security 🔒
- Adopted trusted publishers / Github Actions to publish releases
- Added a minimum release age of 7 days for dependencies
- Removed unmaintained dependency
As well as improving the CI setup to run integration and e2e tests across more variants to reduce risk of regressions 🧪
⚠️ Breaking Changes
--schema-builderdefaults tozod-v4--schema-builderno longer acceptszod, you must specify eitherzod-v3orzod-v4as required for your project
Full changes
- feat: set minimumReleaseAge of 7 days by @mnahkies in #363
- chore: update biome by @mnahkies in #364
- chore: upgrade documentation related dependencies by @mnahkies in #365
- refactor: avoid dependency on concrete schema builders by @mnahkies in #367
- fix: integration tests pass with joi schema builder by @mnahkies in #368
- test: run integration for all schema builders by @mnahkies in #369
- fix: use nodejs built-in sourcemap support by @mnahkies in #370
- chore: update deps by @mnahkies in #371
- refactor: rename zod.ts -> zod-v3.ts by @mnahkies in #372
- feat!: support both zod v3 and zod v4 by @mnahkies in #366
- docs: fix example commands by @mnahkies in #373
- fix: use import type when possible by @mnahkies in #374
- fix: consistently use json5 by @mnahkies in #376
- fix: replace markdown-toc with remark-toc by @mnahkies in #377
- feat: support esm projects by @mnahkies in #375
- feat: adopt trusted publishers by @mnahkies in #378
- fix: avoid lerna reformatting lockfile by @mnahkies in #379
Full Changelog: v0.21.1...v0.22.0
v0.22.0-alpha.0
What's Changed
This is a pretty significant release, with two larger features:
- Support for Zod V4, whilst retaining support for Zod V3
- Support for projects using ESM, and use
import typewhere possible
As such it's being made available as an alpha release for further regression testing: https://www.npmjs.com/package/@nahkies/openapi-code-generator/v/0.22.0-alpha.0
Aside from this, we've made efforts to improve supply chain security 🔒
- Adopted trusted publishers / Github Actions to publish releases
- Added a minimum release age of 7 days for dependencies
- Removed unmaintained dependency
As well as improving the CI setup to run integration and e2e tests across more variants to reduce risk of regressions.
⚠️ Breaking Changes
--schema-builderdefaults tozod-v4--schema-builderno longer acceptszod, you must specify eitherzod-v3orzod-v4as required for your project
Full details:
- feat: set minimumReleaseAge of 7 days by @mnahkies in #363
- chore: update biome by @mnahkies in #364
- chore: upgrade documentation related dependencies by @mnahkies in #365
- refactor: avoid dependency on concrete schema builders by @mnahkies in #367
- fix: integration tests pass with joi schema builder by @mnahkies in #368
- test: run integration for all schema builders by @mnahkies in #369
- fix: use nodejs built-in sourcemap support by @mnahkies in #370
- chore: update deps by @mnahkies in #371
- refactor: rename zod.ts -> zod-v3.ts by @mnahkies in #372
- feat!: support both zod v3 and zod v4 by @mnahkies in #366
- docs: fix example commands by @mnahkies in #373
- fix: use import type when possible by @mnahkies in #374
- fix: consistently use json5 by @mnahkies in #376
- fix: replace markdown-toc with remark-toc by @mnahkies in #377
- feat: support esm projects by @mnahkies in #375
- feat: adopt trusted publishers by @mnahkies in #378
- fix: avoid lerna reformatting lockfile by @mnahkies in #379
Full Changelog: v0.21.1...v0.22.0-alpha.0
v0.21.1
What's Changed
Bug fix release for #360 / #361 - previously nullable string schemas with a default of null would instead default to the string "null" - thanks @geuben!
Bug Fixes
- fix: coercion of null default values by @geuben in #360
- fix: joi supports string values with null default by @mnahkies in #361
Misc
New Contributors
Full Changelog: v0.21.0...v0.21.1
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-Typewill now generateneveras their typescript type - HTML form data submissions (
application/x-www-form-urlencoded) are now supported text/plainrequest 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
enumto restrict them to literaltrueorfalse - 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