Time to put everything into practice. These exercises go from simple to complex. Do them in order. Each one builds on the previous.
Hit GET https://jsonplaceholder.typicode.com/posts/1 and write a JSON Schema from scratch for the response. Include: required fields, correct types, minimum values for IDs, and minLength for strings.
// Expected response shape:
{
"userId": 1,
"id": 1,
"title": "sunt aut facere ...",
"body": "quia et suscipit ..."
}Write a complete schema for the Banking Portal login response. The response includes userId, token, account details with nested holder and address, and a transactions array. Use enum for accountType, pattern for PAN and phone, and additionalProperties: false. Validate in both Postman and REST Assured.
For each exercise, first break your schema intentionally. See what the error message looks like. Then fix it. This builds muscle memory for debugging schema failures in real projects.
Key Point: Practice writing schemas from scratch, validating in both Postman and REST Assured, and always test your schema by breaking it intentionally to understand the error messages.