JSON Schema validates the rules you actually wrote
Readable JSON is not necessarily suitable for a request. A schema describes expected data, but cannot enforce an unwritten condition or establish facts outside that data.
A property’s presence and type are separate decisions
Defining a property in properties constrains it when present; that alone does not make it mandatory. Use required when the property must actually arrive.
The number 3 and the string "3" are different values. Acceptance of one does not imply automatic conversion of the other. Design the contract around the consumer’s needs instead of guessing its intentions.
References: JSON Schema — Properties, required fields and additional properties
Decide whether additional fields are welcome
In a simple object schema, additionalProperties: false rejects undeclared fields. This can catch a misspelled name, but also needs a deliberate update when the contract expands.
Test one example with a missing field, another with a wrong type and a third with an extra property. Results are easier to interpret when each example targets a known rule.
References: JSON Schema — Properties, required fields and additional properties
Schema compliance is not approval of the request
ToolRoof checks a local subset of Draft 2020-12. It does not retrieve remote schemas or support every keyword, and reports unsupported features instead of silently treating them as valid.
A pass does not establish that a product exists, that a database price is correct or that a user is authorized. A default annotation also does not populate a missing input property in this checker.
Example: a required quantity without hidden coercion
Suppose the contract requires an object with quantity as an integer of at least 1, lists quantity in required and rejects additional properties. {"quantity":3} passes, while {"quantity":"3"} fails the type requirement.
{} fails because the property is missing. {"quantity":3,"note":"draft"} fails because of the additional property. Even a passing quantity of 3 does not prove that three units are in stock; that is outside this example’s rules.