Validate JSON data with schemas, types, required fields, formats, composition, and API contracts.
Lessons
Constrain a value to one or more JSON types.
The type Keyword is easiest to learn by reading the example, changing it, and observing the result.
{
"type": "object",
"properties": {
"title": { "type": "string" },
"minutes": { "type": "number" },
"active": { "type": "boolean" },
"tags": { "type": "array" },
"meta": { "type": "object" },
"note": { "type": "null" }
}
}Practice the The type Keyword example in a small scratch file, then explain what changed and why.