Skip to content

v2.15.0

Compare
Choose a tag to compare
@samchungy samchungy released this 06 Apr 02:26
· 50 commits to master since this release
96b3794

What's Changed

New Features 馃帀

  • Support OpenAPI 3.1 const value by @samchungy in #240

    ZodLiteral values will now be represented using the const keyword instead of a single value enum array in OpenAPI 3.1.0.

    The following object, this will be now rendered as such:

    z.object({
      foo: z.literal('foo')
    });
     foo:
       type: 'string'
    -  enum:
    -    - 'foo'
    +  const: 'foo'

Other Changes

  • z.literal(undefined) is now treated the same way as z.undefined() when used in objects.
  • z.literal(null) is now treated the same way as z.null().

Full Changelog: v2.14.0...v2.15.0