7 ms·
That's a good point. I just realized that I am working around this problem by explicitly setting a `z.Schema<...>` type: [link redacted]. The reason was to ret
by kristiandupont 3y ago
That's a good point.
I just realized that I am working around this problem by explicitly setting a `z.Schema<...>` type: [link redacted]. The reason was to retain JSDoc comments on the types, but I guess this was another positive side effect.
In any case, I agree with you that there is room for improvement.
- lf-non 3y agoAh ok. However, typescript is mostly smart enough to propagate comments [1] from zod schema properties to inferred types on its own. Thanks for maintaining kanel btw. We used to use this in a previous role alongside knex. It was very useful. [1] https://lorefnon.me/2022/06/25/generating-api-docs-for-zod-types/ https://lorefnon.me/2022/06/25/generating-api-docs-for-zod-t...
- kristiandupont 3y agoHah, I wasn't aware! I think that must have been fixed after I tried it the first time because I definitely concluded that it was necessary back then. And thank you for the kind words!