In our project, we would like to use Zod in combination with zod-to-json-schema. One feature that we are missing is a parameter to pass an example value for a field.
Here is an example:
const apiSchema = {
params: z.object({
id: z.string({
description: 'An identifier for the resource.',
example: '9c235211-6834-11ea-a78c-6feb38a34414',
}),
}),
};
In our project, we would like to use Zod in combination with zod-to-json-schema. One feature that we are missing is a parameter to pass an example value for a field.
Here is an example:
Which after conversion, it will look like this:
And here is the representation of this schema in Swagger: