Releases: mnahkies/openapi-code-generator
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
v0.14.0
What's Changed
Fixes a few small bugs, and adds support for relative $ref
s when using a URI as the input.
Features
Bug fixes
- fix: allow
$ref
to be used as a schema property by @mnahkies in #250 - fix: handle
type: "null"
inanyOf
/oneOf
/allOf
by @mnahkies in #252
Misc
- chore(deps): update all dependencies by @renovate in #251
- fix(docs): use absolute url for og:image by @mnahkies in #253
- chore(docs): switch to self-hosted plausible ce by @mnahkies in #249
Full Changelog: v0.13.0...v0.14.0
v0.13.0
What's Changed
This release adds support for schemas specifying default values, and begins validating / parsing incoming request headers. Note: this may be a breaking change if your server currently accepts requests with invalid request headers.
Features
- feat: support default values by @mnahkies in #241
- feat!: parse/validate request headers by @mnahkies in #247
- feat: include urls from servers array in basePath type by @mnahkies in #246
Docs
Misc
- chore(deps): update all dependencies by @renovate in #239
- chore(deps): Bump micromatch from 4.0.7 to 4.0.8 by @dependabot in #240
- chore: update dependencies and refresh data files by @mnahkies in #244
- chore: upgrade typescript by @mnahkies in #245
Full Changelog: v0.12.1...v0.13.0
v0.12.1
What's Changed
This release fixes a small typing mistake preventing queries parameters of type number[]
from building properly, and fixes bugs in the handling of header parameters / defaults and the "escape hatch" parameters allowing arbitrary fetch / axios request options to be passed.
It's also the first release with automated end-to-end tests in place, though the coverage is still low - this will be improved during the course of development going forward.
Bug fixes
- fix: allow number array query param by @mnahkies in #236
- fix(fetch/axios): correctly merge headers from opts by @mnahkies in #231
Testing
Misc
- chore(deps): update dependency axios to v1.7.4 [security] by @renovate in #232
- chore: dependencies / refresh data by @mnahkies in #233
- chore: tweak npm metadata by @mnahkies in #234
- chore: use node 22 by default by @mnahkies in #237
Full Changelog: v0.12.0...v0.12.1
v0.12.0
What's Changed
Another small release, adding a new CLI parameter OPENAPI_REMOTE_SPEC_REQUEST_HEADERS
/ --remote-spec-request-headers
that allows request headers to be sent when fetching specifications from remote URI's.
This makes it possible to generate from a remote URI that is behind some form of header based authentication, eg: Authorization: Bearer <bla>
(which includes cookie based authentication since cookies are just a Cookie
header, and basic auth as this is just Authorization: Basic <credentials>
).
The headers are scoped to specific domains/urls such that you can mix and match sources without leaking tokens to the wrong servers.
Features
Misc
Full Changelog: v0.11.2...v0.12.0
v0.11.2
What's Changed
This is a bug fix release, solving an issue with the order schemas were output when generating from specifications that are split over multiple files, causing variable used before declaration issues.
Bug fixes
Documentation
Full Changelog: v0.11.1...v0.11.2
v0.11.1
What's Changed
This is a bug fix release, containing a solution for #217.
Previously query parameters of an array type did not work when a single element was provided, now this will be parsed and handed to the route handler as an array of one element.
Bug fixes
Misc
- chore(deps): update all dependencies by @renovate in #210
- chore(deps): update all dependencies by @renovate in #221
- chore: refresh data / use new okta specs by @mnahkies in #222
- chore: update dependencies by @mnahkies in #223
- fix: peer dependency by @mnahkies in #224
Full Changelog: v0.11.0...v0.11.1
v0.11.0
What's Changed
This release contains 1 bug fix for default header handling in typescript-axios
and several internal refactoring changes required to facilitate the work-in-progress documentation playground
Also dropped eslint
for biome
because I can't be bothered figuring out the eslint@^9
upgrade / configuration migration.
Bug fixes
Internal refactoring
- fix: make logger compatible with web by @mnahkies in #211
- fix: decouple validator from readline by @mnahkies in #212
- feat: add a prettier based formatter by @mnahkies in #213
- fix: move tsconfig loading by @mnahkies in #214
- fix: decouple typespec loader from readline by @mnahkies in #215
Misc
Full Changelog: v0.10.0...v0.11.0
v0.10.0
What's Changed
This release is primarily bug fixes, and internal refactoring to facilitate improvements to documentation. Most effort has gone into the new documentation site live at https://openapi-code-generator.nahkies.co.nz/
It also splits the cli
from the library entrypoint such that you can now import {generate} from '@nahkies/openapi-code-generator'
for programmatic usage if you wish, and improves handling of boolean cli flags.
BREAKING CHANGES
There are several potentially breaking changes here:
- Dropped the "safe edit region" functionality, I doubt anyone was using this and it wasn't particularly robust
- Improved handling of
additionalProperties
/{}
schemas to better align with the specification - Joi validation became stricter for strings with format
email
/date-time
This may make some schemas / types change type to unknown
, and start serializing/deserializing values that were previously stripped (see #200). If you want more permissive types (any
) in these situations rather than unknown
you can use the --ts-allow-any
cli flag.
Bug fixes
- fix!: an {} schema should be an unknown/any type by @mnahkies in #204
- fix!: drop safe edit regions by @mnahkies in #198
- fix!: joi supports email / date-time string formats by @mnahkies in #206
- fix: improve handling of cli boolean params by @mnahkies in #205
- fix: only allow publish of releases from latest main by @mnahkies in #161
Internal refactoring
- refactor: create TypescriptFormatter class by @mnahkies in #199
- refactor: isolate filesystem interaction by @mnahkies in #201
- refactor: split cli to allow programmatic use by @mnahkies in #202
Docs
- feat: new documentation website by @mnahkies in #162
- feat: publish docs from ci, add ga to docs by @mnahkies in #163
- fix: provide a user by @mnahkies in #164
- fix: try git config by @mnahkies in #165
- fix: set url by @mnahkies in #166
- fix: move script to _app by @mnahkies in #167
- fix: replace default nextra meta descriptions by @mnahkies in #168
- docs: show typespec shell snippets, mention runtime response validation by @mnahkies in #169
- docs: move architecture into nextra site by @mnahkies in #186
- docs: update readme by @mnahkies in #187
- fix(docs): correct header level by @mnahkies in #209
Misc
- chore: upgrade dependencies / angular v18 by @mnahkies in #207
- chore: refresh data and regenerate by @mnahkies in #208
- chore: bump lerna by @mnahkies in #203
- fix: make renovate less noisy by @mnahkies in #197
- chore: Configure Renovate by @renovate in #170
- chore(deps): update dependency @azure-tools/typespec-client-generator-core to v0.41.8 by @renovate in #171
- chore(deps): update dependency @types/node to v20.12.8 by @renovate in #172
- fix(deps): update angular monorepo by @renovate in #175
- chore(deps): update dependency typescript to ~5.4.0 by @renovate in #180
- chore(deps): update dependency node to v20.12.2 by @renovate in #179
- chore(deps): update yarn to v4.2.1 by @renovate in #182
- chore(deps): update dependency zod to v3.23.6 by @renovate in #174
- chore(deps): update typescript-eslint monorepo to v7.8.0 by @renovate in #181
- fix(deps): update dependency ajv to v8.13.0 by @renovate in #183
- chore(deps): update dependency eslint-plugin-jest to v28.5.0 by @renovate in #178
- fix(deps): update dependency @biomejs/biome to v1.7.2 by @renovate in #176
New Contributors
Full Changelog: v0.9.0...v0.10.0