You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by epotter2297 October 11, 2022
It would be really cool if there was a way to use zod to validate my path parameters. For example, if I have an endpoint like so:
{method: 'get',path: '/users/:id',alias: 'getUser',description: 'Get a user',response: z.object({id: z.number(),name: z.string().nullable(),}),},
And I want to make sure that id is a valid UUID, I could do something like:
{method: 'get',path: '/users/:id',alias: 'getUser',description: 'Get a user',parameters: [{name: 'id',description: 'The user id',type: 'Path',schema: z.string().uuid(),},],response: z.object({id: z.number(),name: z.string().nullable(),}),},```</div>
The text was updated successfully, but these errors were encountered:
Discussed in #176
Originally posted by epotter2297 October 11, 2022
It would be really cool if there was a way to use zod to validate my path parameters. For example, if I have an endpoint like so:
And I want to make sure that
id
is a valid UUID, I could do something like:The text was updated successfully, but these errors were encountered: