Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add description property to Zod generated schema #1715

Open
karlismelderis-mckinsey opened this issue Nov 26, 2024 · 2 comments
Open

Add description property to Zod generated schema #1715

karlismelderis-mckinsey opened this issue Nov 26, 2024 · 2 comments
Assignees
Labels
zod Zod related issue

Comments

@karlismelderis-mckinsey
Copy link
Contributor

How hard would it be for you to add related schema name as description to generated Zod schema?

It would allow us to log Schema name in case zod validation fails by pulling data from <zodSchema>.description instead of passing around arbitrary string argument

here is an example:

const getCatsParams = zod.object({
  name: zod.string(),
}, {description: 'GetCatsParams'});

console.log(getCatsParams.description)

if you agree to this change I can try to create a PR

@melloware melloware added the zod Zod related issue label Nov 26, 2024
@melloware
Copy link
Collaborator

i would say submit the PR for review!

@karlismelderis-mckinsey
Copy link
Contributor Author

i would say submit the PR for review!

🫡
Will try to help out here

🙏
We have some other work ahead of us so I don't expect any movement until Q1 next year

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zod Zod related issue
Projects
None yet
Development

No branches or pull requests

2 participants