> Schema validation provides assurance that data is strictly similar to a set of patterns, structures, and data types you have provided. It helps identify quality issues earlier in your codebase and prevents errors that arise from incomplete or incorrect data types.
Most common use case I’ve seen is using schema validation for user input (like forms) so you don’t send junk off to the api, you can validate data at runtime (whereas typescript checks your types statically when compiled).
ShadowBanThis01|2 years ago
But schemas for what?
9935c101ab17a66|2 years ago
From: https://blog.logrocket.com/schema-validation-typescript-zod/
Most common use case I’ve seen is using schema validation for user input (like forms) so you don’t send junk off to the api, you can validate data at runtime (whereas typescript checks your types statically when compiled).