-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Hello Zod Team!
First of all I would like to send some KUDOs. Zod is an awesome tool. Been looking for something like this for a long time.
I'd be missing one feature in zod. Wouldn't it make sense to have an .example() method to provide example values:
zod.string(s).describe("This is the name of your customer").example("John Doe");
An example is something different than a default value. It will never be returned. It is just a guide to the caller of your API. Sure I could put the example values into the description. But think about where zod is used. For example to define a REST API. For example in Swagger/OpenAPI example values are seperate from descriptions. Same in MCP servers. Example values for api attributes are crucial for the LLM.
MichiSpebach
Metadata
Metadata
Assignees
Labels
No labels