Validate JSON data with schemas, types, required fields, formats, composition, and API contracts.
Lessons
Use minimum, maximum, and exclusive bounds.
Number Ranges is easiest to learn by reading the example, changing it, and observing the result.
{
"type": "object",
"properties": {
"rating": {
"type": "number",
"minimum": 0,
"maximum": 5
},
"discount": {
"type": "number",
"exclusiveMinimum": 0,
"exclusiveMaximum": 100
}
}
}Practice the Number Ranges example in a small scratch file, then explain what changed and why.