Skip to content

Releases: mnahkies/openapi-code-generator

v0.25.0

31 May 14:55
efcd63a

Choose a tag to compare

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

Full Changelog: v0.24.0...v0.25.0

v0.24.0

27 May 20:32
7ecd4e4

Choose a tag to compare

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 axios instance that itself had a default timeout configured, the axios default of no timeout was used
  • Now the defaultTimeout value will be respected, overriding that of the passed axios instance
  • #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 tsdown configuration updated to prevent re-occurrence
  • #471

✨ Features

  • zod-v4 schema generation now uses z.object({...foo.shape, ...bar.shape}) or s_Foo.extend(z.object({...})) as appropriate, instead of the deprecated merge function. According to the documentation this may bring some boost to tsc / language server performance (#468)
  • (potentially breaking) zod-v4 schema generation will now validate format: date and format: time using z.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

Full Changelog: v0.23.0...v0.24.0

v0.23.0

09 May 14:02
a817982

Choose a tag to compare

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
  • koa v3 and @koa/router@v15 now the minimum requirement #442
  • Dropped broken readOnly modifier support #409

✨ Features

  • Binary Data Support: Added support for application/octet-stream in both request and response bodies #359
  • Improved Records: Better handling of additionalProperties, emitting Record<string, T> or any as appropriate #408, #402
  • Middleware: Added support for mounting middleware on individual routers via an optional parameter to createRouter #442
  • Improved handling of allOf, anyOf, and oneOf #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...
Read more

v0.22.0

02 Nov 13:05
206e789

Choose a tag to compare

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 type where 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-builder defaults to zod-v4
  • --schema-builder no longer accepts zod, you must specify either zod-v3 or zod-v4 as required for your project

Full changes

Full Changelog: v0.21.1...v0.22.0

v0.22.0-alpha.0

26 Oct 16:40
8bee335

Choose a tag to compare

v0.22.0-alpha.0 Pre-release
Pre-release

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 type where 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-builder defaults to zod-v4
  • --schema-builder no longer accepts zod, you must specify either zod-v3 or zod-v4 as required for your project

Full details:

Full Changelog: v0.21.1...v0.22.0-alpha.0

v0.21.1

13 Aug 19:53

Choose a tag to compare

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

26 Jul 12:54

Choose a tag to compare

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 generate never 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 literal true or false
  • 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

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

Full Changelog: v0.20.1...v0.21.0

v0.20.1

31 May 11:42

Choose a tag to compare

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

Full Changelog: v0.20.0...v0.20.1

v0.20.0

05 May 14:01

Choose a tag to compare

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

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

Full Changelog: v0.19.2...v0.20.0

v0.19.2

19 Apr 11:22

Choose a tag to compare

What's Changed

Another attempt to solve running by npx

Bug fixes

Full Changelog: v0.19.1...v0.19.2