Skip to content

Releases: asteasolutions/zod-to-openapi

v7.0.0

05 Apr 10:15
Compare
Choose a tag to compare

What's Changed

  • Added ESM modules export alongside the already present CJS (#219)
  • Added support for .refine() and .transform on ZodObjects in request query/params/headers/cookies (#198)

BREAKING CHANGES ⚠️

❗ None of the changes that we've made are breaking in terms of code integration but their behavior (result) is changed:

Handle zod tuples with prefixItems for OpenAPI v3.1.0 (#221 )

As of OpenAPI v3.1.0 there is a better representation of tuples - ordered items with the use of the prefixItems keyword. See more here

BigInt is now transformed as type string

z.bigint() // this is now transformed to `{ type: 'string', pattern: "^\d+$' }` instead of an `'integer'` type.

A BigInt can represent a number with a arbitrary size and that also means numbers that do not fall in the int64 format. As such for a library based on the JS world it is safer to represent a z.bigint() instance as a string containing only digits. In a real life scenario a BigInt instance can only be created from whatever was passed through HTTPS - and that can be both number and string as a basis.

Along with that the support for the minimum and maximum values have been removed.

Full Changelog: v6.4.0...v7.0.0

v6.4.0

01 Mar 08:41
Compare
Choose a tag to compare

What's Changed

  • make examples use input type instead of output (same as what we sue to generate in the docs) (#189)
  • add autocompletion for common media types
  • handle enums as keys for zod records (#211)

Full Changelog: v6.3.1...v6.4.0

v6.3.1

02 Jan 15:21
Compare
Choose a tag to compare

What's Changed

  • fixed deepPartial modifier preserving refId (#200 )

Full Changelog: v6.3.0...v6.3.1

v6.3.0

16 Nov 15:57
Compare
Choose a tag to compare

What's Changed

  • Bump @babel/traverse from 7.20.12 to 7.23.2
  • #188 - do not label default schemas as required

Full Changelog: v6.2.0...v6.3.0

v6.2.0

17 Oct 13:42
Compare
Choose a tag to compare

What's Changed

  • #176 added support for z.bigint
  • #177 fix .describe for paramters not putting the description in the correct place

Full Changelog: v6.1.0...v6.2.0

v6.1.0

03 Oct 11:18
Compare
Choose a tag to compare

What's Changed

  • #173 Added support for ZodReadonly

Full Changelog: v6.0.0...v6.1.0

v6.0.0

02 Oct 19:02
Compare
Choose a tag to compare

What's Changed

  • [BREAKING] Remove openapi3-ts exports since they break some applications but were never exported as a feature but rather for convenience. If they are needed one can simply add a dependency on openapi3-ts itslef

Full Changelog: v5.5.0...v6.0.0

v5.5.0

05 Aug 16:06
Compare
Choose a tag to compare

What's Changed

  • Combine manually passed parameters from config.parameters with the generated ones from config.request

Full Changelog: v5.4.0...v5.5.0

v5.4.0

31 Jul 07:42
Compare
Choose a tag to compare

What's Changed

  • Added support for cookies in RouteConfig.request object

Full Changelog: v5.3.1...v5.4.0

v5.3.1

17 Jul 07:21
Compare
Choose a tag to compare

What's Changed

  • Fixed schemas not being generated for standard zod types when using a production build with minification / uglification being turned on (#158)

Full Changelog: v5.3.0...v5.3.1