Validate JSON data with schemas, types, required fields, formats, composition, and API contracts.
Lessons
Validate app and CI configuration against a schema.
Validating Config Files is easiest to learn by reading the example, changing it, and observing the result.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["name", "version"],
"properties": {
"name": { "type": "string" },
"version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" },
"scripts": { "type": "object", "additionalProperties": { "type": "string" } }
}
}Practice the Validating Config Files example in a small scratch file, then explain what changed and why.