Attach JSON Validator tools to your REST Clients to validate that the responses are well-formed. This tool can also validate JSON payloads against the following schema definitions:
- OpenAPI/Swagger
- RAML
- JSON Schema
Adding and Configuring a JSON Validator
- Navigate to your test scenario in the left pane and choose a REST Client.
- Choose JSON Validator from the ellipses actions menu.
- (Optional) Modify the name of the newly-created tool.
- Choose the type of JSON validation you want to perform from the Validate drop-down menu.
- If you want the tool to validate that responses are well-formed only, click Save to finish configuring the tool. Go to the next step if you want to validate responses against a supported definition.
- Specify the location of the definition file and the service definition message you want to validate. You can also point to an environment variable using the
${variable-name
} syntax if a variable has been defined in the suite. The resolved URL will appear if you point to a variable. - Click Save to finish configuring the tool.
When the client executes, an error will be reported if one or more of the following conditions apply:
- JSON payload is malformed
- JSON is not included in the payload