This repository was archived by the owner on Aug 27, 2025. It is now read-only.
fix(deps): update dependency zod-openapi to v5 - #15
Open
renovate[bot] wants to merge 2 commits into
Open
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
earthapp-mantle | 220fec2 | Jul 05 2025, 05:02 PM |
Contributor
Author
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^4.2.4->^5.0.0Release Notes
samchungy/zod-openapi (zod-openapi)
v5.0.0Compare Source
zod-openapi v5 📚
This guide explains the key changes between zod-openapi v4 and v5.
You can migrate most of the way with our codemod:
You can see the code here: codemod-zod-openapi-v5.
🔄 Differences from v4
🛠️ Runtime Changes
✨ Using native Zod metadata
Zod v4 introduces a native
.meta()method for metadata, eliminating the need for runtime extensions:extendZodWithOpenApi(z)andimport zod-openapi/extendZod v4 (3.25.74) required
Node v20+ required
📊 Schema Generation Changes
The internal schema generation has been completely replaced with Zod's native
toJSONSchema()method. This should result in an overall performance improvement.However, this will result in some changes to how some schemas are generated. Please raise a GitHub issue if you find any significant discrepancies.
🆕 OpenAPI version requirements
✨ Lazy schemas supported natively
🔄 Component references renamed:
ref→idWherever you previously used
refto create components within parameters, request objects and responses, has been replaced withidfor consistency with Zod's syntax.📝 Input & Output Schema Generation
Zod's native
toJSONSchema()handles object schemas differently than our previous implementation:additionalPropertiesspecified)additionalProperties: false)This better aligns with how Zod objects actually works, where input schemas are more permissive and output schemas are stricter and allows for structured outputs for AI applications.
As a result, when a schema containing a zod object with an ID is used in both request and response contexts, the library automatically generates two separate component schemas to properly represent the different behaviors.
How it works:
Customization options:
.meta({ id: 'Person', outputId: 'CustomOutputName' })outputIdSuffixinCreateDocumentOptionsto change from default "Output"In certain cases, the same component can be used for both
inputandoutputcontexts. This happens when the schemas are identical - for example, with primitive types likez.string().meta({ id: 'SimpleString'}). The library performs an equality check between input and output representations to determine when a single schema can be safely reused for both contexts.For object schemas, you can explicitly control this behavior by using
z.looseObject()(which allows additional properties) orz.strictObject()(which forbids them) instead of the standardz.object().⚡ Minor change: Manual schema generation
⚡ Minor change:
.extend()behaviorallOfreferenced schema🔧 Zod OpenAPI Options
🔁 Renamed Options
🔄
refType→unusedIO❌ Removed Options
⚙️
effectType🔄
unionOneOf🔄
enforceDiscriminatedUnionComponents🔄
defaultDateSchema🛠️ New Override System
Direct property setting:
This is native to Zod v4 and allows you to set properties directly on the schema.
Simple example:
Advanced customization with functions:
Global overrides:
✨ New Options
🔄
cycles,reused🧩
allowEmptySchema🔁 Changed Options
🔄
refType→unusedIO📋 Create Schema Options
🔄
schemaType→io🔄
componentRefPath→schemaComponentRefPath🔄
components→schemaComponents🧩 New Components
PathItems, SecuritySchemes, Links, and Examples can now be created as reusable components
🔌 zod-openapi/api Changes
See ./api.md for detailed API changes in v5.
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.
This PR was generated by Mend Renovate. View the repository job log.