Validate JSON data with schemas, types, required fields, formats, composition, and API contracts.
Lessons
Require some elements to match a schema.
contains, minContains & maxContains is easiest to learn by reading the example, changing it, and observing the result.
{
"type": "array",
"contains": { "type": "string", "const": "admin" },
"minContains": 1,
"maxContains": 2
}Practice the contains, minContains & maxContains example in a small scratch file, then explain what changed and why.