Skip to content

Fix jsonSchema method#172

Open
diervo wants to merge 2 commits intovercel-labs:mainfrom
diervo:fix/json-schema-components
Open

Fix jsonSchema method#172
diervo wants to merge 2 commits intovercel-labs:mainfrom
diervo:fix/json-schema-components

Conversation

@diervo
Copy link

@diervo diervo commented Feb 26, 2026

This PR fixes the jsonSchema method which was not ported to support v3|v4 converstion.
Moreover I assumed that the expected behavior was to serialize the catalog (instead of the schema) so that it aligns with the prompt behavior

@vercel
Copy link
Contributor

vercel bot commented Feb 26, 2026

@diervo is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@diervo
Copy link
Author

diervo commented Feb 26, 2026

@ctate let me know if this the behavior you would expect for the jsonSchema method,
It makes sense to me but happy to adjust.

@diervo diervo changed the title Fix/json schema components Fix jsonSchema method Feb 26, 2026
};
}
case "ZodObject": {
const shape = (def.shape as () => Record<string, z.ZodType>)?.();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zodToJsonSchema for z.literal() reads def.value which is undefined in Zod 4, producing {} instead of { const: "hello" }

Fix on Vercel

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