Recall & Review
beginner
What is JSON Schema validation?
JSON Schema validation is a way to check if a JSON response matches a defined structure and rules. It ensures the data format is correct.
Click to reveal answer
beginner
How do you use JSON Schema validation in Postman tests?
In Postman, you write a test script that uses the 'pm.expect' function with 'tv4.validate' or 'ajv.validate' to check the response against a JSON schema.
Click to reveal answer
beginner
What is the role of 'required' in a JSON Schema?
The 'required' keyword lists properties that must be present in the JSON data for the validation to pass.
Click to reveal answer
beginner
Why is JSON Schema validation useful in API testing?
It helps catch errors early by verifying the API response structure, making sure the data is complete and correctly formatted.
Click to reveal answer
beginner
What happens if JSON Schema validation fails in a Postman test?
The test will fail, showing an error message that the response does not match the expected schema.
Click to reveal answer
Which keyword in JSON Schema specifies properties that must be present?
✗ Incorrect
The 'required' keyword lists the properties that must exist in the JSON data.
In Postman, which function is commonly used to assert JSON Schema validation?
✗ Incorrect
pm.expect() is used to write assertions, including JSON Schema validation.
What does JSON Schema validation check in API responses?
✗ Incorrect
JSON Schema validation checks if the response structure and data types match the schema.
If a JSON Schema validation fails, what is the usual outcome in Postman?
✗ Incorrect
A failed validation causes the test to fail and shows an error message.
Which of these is NOT a valid JSON Schema data type?
✗ Incorrect
'function' is not a valid JSON Schema data type.
Explain how JSON Schema validation helps improve API testing in Postman.
Think about how validating the shape and content of data helps avoid bugs.
You got /5 concepts.
Describe the steps to add JSON Schema validation in a Postman test script.
Focus on writing the schema and using Postman test functions.
You got /5 concepts.