Skip to content

Latest commit

 

History

History
118 lines (69 loc) · 3.9 KB

File metadata and controls

118 lines (69 loc) · 3.9 KB

zod-openapi

5.4.5

Patch Changes

5.4.4

Patch Changes

  • #556 2f8db8a Thanks @samchungy! - Fix crash when generating discriminated union schemas with Zod 4.1.13+

5.4.3

Patch Changes

5.4.2

Patch Changes

5.4.1

Patch Changes

5.4.0

Minor Changes

5.3.1

Patch Changes

5.3.0

Minor Changes

  • c43d544 Thanks @samchungy! - Remove zodSchemas from meta override

    This should result in faster type inference when using .meta().

    zodSchemas is still available in the CreateDocumentOptions override function.

    The mis-scoped Override type is now exported as ZodOpenApiOverride and ZodOpenApiOverrideMeta

Patch Changes

5.2.0

Minor Changes

  • #480 5c3f98a Thanks @samchungy! - Change ZodUndefined behaviour

    This restores how z.undefined() is rendered to pre Zod v3.25.75.

    It is now rendered as:

    {
      "not": {}
    }

    If you want to override this behaviour you can customise this with the override function passed into the createDocument function.

    eg.

    import { createDocument } from 'zod-openapi';
    
    createDocument(
      z.object({
        name: z.undefined().optional(),
      }),
      {
        override: (ctx) => {
          if (ctx.zodSchema._zod.def.type === 'undefined') {
            // This will change the behaviour back to throwing an error
            delete ctx.jsonSchema.not;
          }
        },
      },
    );

5.1.1

Patch Changes

  • 779d22b: Fix ZodAny and ZodUnknown optionals

5.1.0

Minor Changes

  • bfc5754: Allow peer versions of zod: ^4.0.0

  • bfc5754: Expose path in override hook

    This provides context of where the override is being applied, which can be useful when throwing errors

5.0.1

Patch Changes

  • d71fe72: Preserve non Zod schemas