Open oscartbeaumont opened 1 year ago
I'm actually trying to figure out how to do JSDoc comments on individual fields (rather than the full struct ) for this reason as a short-term solution. Using ts-to-zod (https://www.npmjs.com/package/ts-to-zod), one could take the output from this schema with the JSDoc Tag Validators and generate a zod schema with the right frontend validation logic.
Investigate the idea of a built-in input validation library that has typesafe errors with the frontend.