Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Jul 18, 2025

This PR contains the following updates:

Package Change Age Confidence
@asteasolutions/zod-to-openapi ^7.3.4 -> ^8.1.0 age confidence

Release Notes

asteasolutions/zod-to-openapi (@​asteasolutions/zod-to-openapi)

v8.1.0

Compare Source

What's Changed

  • Improve Zod v4 type compatibility in module augmentation (fixes #​321 ) thanks to @​YeeP79
  • Add option to sort schemas and parameters (fixes: #​312) See more details on how to use it here

Full Changelog: asteasolutions/zod-to-openapi@v8.0.0...v8.1.0

v8.0.0

Compare Source

Added Zod v4 support 🚀

Support for properties from .meta

With zod's new option for generating JSON schemas and maintaining registries we've added a pretty much seamless support for all metadata information coming from .meta calls as if that was metadata passed into .openapi.

So the following 2 schemas produce exactly the same results:

const schema = z
  .string()
  .openapi('Schema', { description: 'Name of the user', example: 'Test' });

const schema2 = z
  .string()
  .meta({ id: 'Schema2', description: 'Name of the user', example: 'Test' });
Removing extendZodWithOpenApi

This also means that unless you are using some of our more complicated scenarios you could even generate a schema without using extendZodWithOpenApi in your codebase and only rely on .meta to provide additional metadata information and schema names (using the id property).

Where would you still need to use extendZodWithOpenApi and .openapi
  1. When extending registered schemas that are both registered and want the extended one to use anyOf i.e:
const schema = z.object({ name: z.string() }).openapi('Schema');

const schema2 = schema.extend({ age: z.number() }).openapi('Schema2'); // this one would have anyOf and a reference to the first one
  1. Defining parameter metadata. So for example when doing:
registry.registerPath({
  // ...
  request: {
    query: z.object({
      name: z.string().openapi({
        description: 'Schema level description',
        param: { description: 'Param level description' }, 
      }),
    }),
  },
});

the result would be:

  "parameters": [
      {
        "schema": {
          "type": "string",
          "description": "Schema level description" // comes directly from description
        },
        "required": true,
        "description": "Param level description", // comes from param.description
        "name": "name",
        "in": "query"
      }
  ],

What's Changed as well

  • Added support for required modifier (fixes #​305)*
  • Added support for conditional oneOf instead of anyOf for unions (fixes #​236 and #​227). Read more about in the README
  • Exposed a getRefId function (fixes #​319)

Full Changelog: asteasolutions/zod-to-openapi@v7.3.4...v8.0.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/asteasolutions-zod-to-openapi-8.x branch 3 times, most recently from 39624b5 to fe7c87b Compare August 13, 2025 16:05
@renovate renovate bot force-pushed the renovate/asteasolutions-zod-to-openapi-8.x branch from fe7c87b to 6da10c6 Compare August 19, 2025 17:51
@renovate renovate bot force-pushed the renovate/asteasolutions-zod-to-openapi-8.x branch from 6da10c6 to 98d3270 Compare August 31, 2025 10:49
@renovate renovate bot force-pushed the renovate/asteasolutions-zod-to-openapi-8.x branch from 98d3270 to 15a76a7 Compare September 25, 2025 15:14
@renovate renovate bot force-pushed the renovate/asteasolutions-zod-to-openapi-8.x branch from 15a76a7 to 8bd8fe1 Compare October 21, 2025 10:53
@renovate renovate bot force-pushed the renovate/asteasolutions-zod-to-openapi-8.x branch from 8bd8fe1 to bec3fff Compare November 11, 2025 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant