withMeta().example() not working with input that come from router with route path params #1365
-
Hi @RobinTail, this maybe some more problem with the auto generate document, when I want to use them with the endpoint which include dynamic routing that come from params and the body is json(POST/PUT request), the wrap withMeta().example() currently not working with input at all, they only show the default version of example in all case. Can you suggest temp fix or a patch to fix this ??? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Current version: "express-zod-api": "^14.1.0" |
Beta Was this translation helpful? Give feedback.
-
Hello @huyhoang160593 .
In order to do that, I need to understand the problem better. |
Beta Was this translation helpful? Give feedback.
-
I have an endpoint in example that is using route path parameter and using that parameter in express-zod-api/example/routing.ts Lines 17 to 19 in 99a2820 express-zod-api/example/endpoints/update-user.ts Lines 24 to 25 in 99a2820 Then it goes into the generated documentation: express-zod-api/example/example.swagger.yaml Lines 169 to 174 in 99a2820 So, basically this case (at least how I understand it), is covered by tests and operational. |
Beta Was this translation helpful? Give feedback.
@RobinTail yeah so after doing the minimal repoduction, I realise that it's totally my fail, cause of my complicated schema, so that the example is valid in the typescript but fail in zod checking, in that case the example will fail back to the default one @@. Thanks you for taking the time to provide more detail, I'm very appreciate that