-
Hi, sorry to bother you again, but I get this error if a schema is used as a body parameter and as a response schema: The ZodObject at /entities/Model/search > post > responses > 200 > content > application/json > schema is used within a registered compoment schema (ModelSearch) and contains an input transformation (ZodDefault) defined at ....: parameters which is also used in an output schema. Your explanation in the error is clear but not if the transformation is z.default. I can solve it only by adding optional() but that is not what i want. Can i use some other zod effect to prevent this error? Thanks for your info... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
https://github.com/samchungy/zod-openapi#zod-effects G'day, I think I explain it in that section |
Beta Was this translation helpful? Give feedback.
-
Ok, the problem ws that i cannot add the openapi({effectType: "same"}) to the base schema. |
Beta Was this translation helpful? Give feedback.
Ok, the problem ws that i cannot add the openapi({effectType: "same"}) to the base schema.
After adding the same schema with .openapi({effectType: "same"}) not to the base but to the schema components it works.