Validate JSON data with schemas, types, required fields, formats, composition, and API contracts.
Lessons
Validate keys that match a regular expression.
patternProperties is easiest to learn by reading the example, changing it, and observing the result.
{
"type": "object",
"patternProperties": {
"^[a-z]{2}$": { "type": "string" }
},
"additionalProperties": false
}Practice the patternProperties example in a small scratch file, then explain what changed and why.