Validate JSON data with schemas, types, required fields, formats, composition, and API contracts.
Lessons
Annotate strings as email, uri, uuid, and more.
The format Keyword is easiest to learn by reading the example, changing it, and observing the result.
{
"type": "object",
"properties": {
"email": { "type": "string", "format": "email" },
"id": { "type": "string", "format": "uuid" },
"homepage": { "type": "string", "format": "uri" },
"createdAt": { "type": "string", "format": "date-time" }
}
}Practice the The format Keyword example in a small scratch file, then explain what changed and why.