validation schema

A description of what valid data looks like, checked by code while the program runs so bad data is rejected at the door.

In more detail

A schema says, for example, that email must be a valid email address and age a whole number of at least 18. Unlike TypeScript types it runs at run time, so it can check requests, responses, forms and environment variables. Keeping schemas in one shared package means client and server always enforce the same rules.

Related terms

Taught in

References