Add an option useDefaults (named the same as the similar property in AJV) which uses the JSONSchema default keyword to populate missing values via joi.default.
This is behind an option since default in JSONSchema is an annotation (i.e metadata) and doesn't strictly imply any behavior during validation. The choice to insert defaults in place of missing values is an optional implementation detail provided by some JSONSchema implementations and allowed in the spec.
Add an option
useDefaults
(named the same as the similar property in AJV) which uses the JSONSchemadefault
keyword to populate missing values viajoi.default
.This is behind an option since
default
in JSONSchema is an annotation (i.e metadata) and doesn't strictly imply any behavior during validation. The choice to insert defaults in place of missing values is an optional implementation detail provided by some JSONSchema implementations and allowed in the spec.