nightspite
How do I exclude properties while returning data?
Sure in most of the cases, but in the edge case, where for example a value of one property is
null
I would rather have it returned with the null there than to have a validation error.
Or in the case of using the same schema for validating input (for example setting min length of a string) and output, if a record with min length that would not satisfy this validation would also throw the error, even tho it might be unnecessary.
Just my way of thinking about this problem. I had this problem with ts-rest, that is also using zod for validating output, that's why it's on my mind and I'm looking for other ways to solve it6 replies