Skip to content

Releases: mnahkies/openapi-code-generator

v0.18.0

22 Dec 11:21
Compare
Choose a tag to compare

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 to joi
  • Unused Res and StatusCode types removed from typescript-axios-runtime package
  • TypedFetchResponse removed from typescript-fetch-runtime package, use exported type Res 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

Full Changelog: v0.17.0...v0.18.0

v0.17.0

11 Dec 07:16
Compare
Choose a tag to compare

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

Bug Fixes

  • fix: support exactOptionalPropertyTypes on client SDKs by @mnahkies in #278
  • fix!: angular modules have unique export names by @mnahkies in #270

Docs

Misc

Full Changelog: v0.16.0...v0.17.0

v0.16.0

02 Nov 12:08
Compare
Choose a tag to compare

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

Full Changelog: v0.15.0...v0.16.0

v0.15.0

27 Oct 17:14
Compare
Choose a tag to compare

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

Full Changelog: v0.14.0...v0.15.0

v0.14.0

12 Oct 12:13
Compare
Choose a tag to compare

What's Changed

Fixes a few small bugs, and adds support for relative $refs when using a URI as the input.

Features

  • feat: support loading relative remote uris by @mnahkies in #254

Bug fixes

  • fix: allow $ref to be used as a schema property by @mnahkies in #250
  • fix: handle type: "null" in anyOf / oneOf / allOf by @mnahkies in #252

Misc

Full Changelog: v0.13.0...v0.14.0

v0.13.0

20 Sep 16:09
Compare
Choose a tag to compare

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

Docs

Misc

Full Changelog: v0.12.1...v0.13.0

v0.12.1

17 Aug 16:08
Compare
Choose a tag to compare

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

Full Changelog: v0.12.0...v0.12.1

v0.12.0

05 Aug 07:03
Compare
Choose a tag to compare

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

  • feat: support remote specs with authentication by @mnahkies in #230

Misc

Full Changelog: v0.11.2...v0.12.0

v0.11.2

29 Jul 17:42
Compare
Choose a tag to compare

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

  • fix: include schemas from all documents in dependency graph by @mnahkies in #227

Documentation

Full Changelog: v0.11.1...v0.11.2

v0.11.1

27 Jul 10:22
Compare
Choose a tag to compare

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

  • fix: support array of 1 for query parameter arrays (round 2) by @mnahkies in #225

Misc

Full Changelog: v0.11.0...v0.11.1