To define a schema you should always have type
properties, which can be
"string"
"number"
or"integer"
"object"
"array"
"boolean"
"null"
type
can be a single string or an array of string.
If a schema is string
, then it can have the following properties as well:
minLength
maxLength
pattern
format
(e.g.date-time
,email
,uri
)
A number
could have the following properties:
multipleOf
minimum
maxiumum
exclusiveMinimum
exclusiveMaximum
A object
could have the following properties:
properties
additionalProperties
:false
indicates properties other than those stated inproperties
are not allowed.required
: an array of string stating the mandatoryproperties
dependencies
: could be either of the following- an object of
{[<this_exists>]: ["then", "these", "are", "required"]}
. - on object of
{[<this_exists>]: <Additional Schema to be Added>}
- an object of