Is it possible to disable output validation errors? #695
-
I'd like output validation errors to result in a console.error on prod environments and a failed response on dev environments. We're using nosql and every once in awhile we get a type wrong, i'd like for the endpoint to just return the data and not go into a complete failure state when that happens. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Hello @ssteuteville . If you allow your endpoint to return wrong types, then the consumer of your API will receive not the ones you promised. Thus you'd just move the errors from one place to another — your Frontend will have to deal with |
Beta Was this translation helpful? Give feedback.
Hello @ssteuteville .
If you allow your endpoint to return wrong types, then the consumer of your API will receive not the ones you promised. Thus you'd just move the errors from one place to another — your Frontend will have to deal with
null
instead of the expectedundefined
, for example.Instead, I'd suggest to create more loose output types using
.or()
.The types validation is the essential goal of the library. It's intended to operate in strict mode.