Also generate zod schema's for parameters and body
Description
At this point the Zod plugin only generates schema's for the responses. It would be useful if it would also generate schema's for the parameters and body.
Yes would it be a very nice thing to add
Would be awesome to have this
And thinking about it, the response is actually the least important to validate
@sjroesink I get the request and going to make it happen, but curious how you're planning to use the parameter and body schemas?
These will be available in the next release. Feedback would be appreciated! 🙌
@mrlubos
@sjroesink I get the request and going to make it happen, but curious how you're planning to use the parameter and body schemas?
In my case, I will be creating forms for the request bodies and parameters. I want to pass a zod schema to these forms so I can parse / validate the eventual values on submit. I would also expect the SDKs to validate the bodies and parameters. Now only the response is validated. Ideally I want to choose which parts I want the SDK to validate because in my case I don't want to validate the responses (I can trust the response output is correct) - validating the response would therefor only negatively impact the performance (especially for large responses).
These will be available in the next release. Feedback would be appreciated! 🙌
Perfect, I'll have a look soon, thanks!
I've updated request schemas in v0.74.0 a bit, it's now a single schema instead of separate schemas for each parameter and request body. Should be straightforward to add support for request validation with Zod from here 🏃
Request validation added in v0.77.0 ✅