Skip to content

Conversation

@davidkna-sap
Copy link
Member

What Has Changed?

This ensures that the examples work as expected, always using a fixed zod version (zod/v4) to ensure broader compatibility of the sample code.

This PR also handles the following deprecations:

  • describe -> .meta({ description })
  • object({}).strict() -> strictObject({})

Draft because this depends on SAP/ai-sdk-js#1187


```ts
import * as z from 'zod';
import * as z from 'zod/v4';
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of importing zod/v4, I would suggest we import zod and put a sentence here recommending people to use zod@v4 package. Also add a note here and link the zod migration guide to tell people, if anything wrong, update their zod to v4 package and also use meta instead of describe. I find it otherwise pretty complex to document all combinations and support old zod versions.

@davidkna-sap davidkna-sap force-pushed the davidkna-sap_version-zod branch from 3956fdf to 1d38484 Compare December 1, 2025 08:41
@davidkna-sap davidkna-sap marked this pull request as ready for review December 1, 2025 09:31
@davidkna-sap davidkna-sap changed the title chore: [JS] Avoid unversioned zod imports & resolve zod v4 deprecations chore: [JS] Add instructions to always use zod@v4 Dec 3, 2025
Copy link
Contributor

@KavithaSiva KavithaSiva left a comment

Choose a reason for hiding this comment

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

LGTM

@KavithaSiva KavithaSiva merged commit 344c0dd into main Dec 12, 2025
8 checks passed
@KavithaSiva KavithaSiva deleted the davidkna-sap_version-zod branch December 12, 2025 12:47
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.

4 participants