-
-
Save GrimDerp/1411d1adcf87a58a6e72e43733a85c17 to your computer and use it in GitHub Desktop.
Using JSON Schema in Postman (via an environment variable)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the JSON Schema | |
const customerSchema = JSON.parse(environment.customerSchema); | |
// Test whether the response matches the schema | |
var customer = JSON.parse(responseBody); | |
tests["Customer is valid"] = tv4.validate(customer, customerSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment