johngeorgewright / runtyping

Generate runtype validation from static types & JSON schema.
MIT License
43 stars 5 forks source link

Joi #350

Open johngeorgewright opened 1 year ago

johngeorgewright commented 1 year ago

Add a Joi typewriter.

johngeorgewright commented 1 year ago

An important note; by default, all Joi validators except undefined as a value. This is the opposite to TS's static types. Therefore, we must specify that every validator is .required(). This will then need to be turned off for optional object properties with the use of .optional().