Closed astahmer closed 2 years ago
Hello Alex,
Thank you for the suggestion. Yes, this could be an option passed to the validation plugin. I think validating both request and response is better for everyone, even on controlled APIs. It allows for fail fast strategies. But yes, i should not impose my views on zodios users. I'll add this.
100% agree that everything should be validated on controlled API, i'm still in those use-cases where I don't have any control on the API used 😓
thanks for the quick answer !
this is now available on @zodios/core
v10.1.0
that was quick 😄 ! thanks
Currently we can validate both the request payload sent and the response content using
validate
or noneContinuing my reasoning (and use-cases for
openapi-zod-client
) that not all APIs are in our own control, and therefore that we can only control what we send in the request payload,would you consider having a validate mode (as a string enum ?) with the current boolean ?
something like:
validate: "request" | "response" | boolean
tbh I don't know if a
response
mode would really be useful but I added it in the example above so that every options are available