0
0
Postmantesting~5 mins

JSON Schema validation in Postman - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Arequired
Bproperties
Ctype
Ditems
In Postman, which function is commonly used to assert JSON Schema validation?
Apm.sendRequest()
Bconsole.log()
Cpm.expect()
Dpm.response.to()
What does JSON Schema validation check in API responses?
AServer status
BResponse structure and data types
CResponse time
DNetwork latency
If a JSON Schema validation fails, what is the usual outcome in Postman?
AResponse is ignored
BTest passes silently
CPostman crashes
DTest fails with an error
Which of these is NOT a valid JSON Schema data type?
Afunction
Binteger
Cboolean
Dstring
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.