specta icon indicating copy to clipboard operation
specta copied to clipboard

Typed input validation

Open oscartbeaumont opened this issue 2 years ago • 1 comments

Investigate the idea of a built-in input validation library that has typesafe errors with the frontend.

oscartbeaumont avatar Sep 04 '23 04:09 oscartbeaumont

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.

natestraub avatar Dec 10 '23 00:12 natestraub