Validate Requests and Responses

Applies to ReadyAPI 3.57, last modified on December 20, 2024

In ReadyAPI, you can check if the data types and values in your requests and responses match the data structure defined in your API specification.

You do this check in the Request editor.

Check Request Data

To validate request parameter values, switch to the Forms page of the request editor and click the toolbar button:

Validating request parameters

ReadyAPI will check if the data type of parameter values matches the request definition in the web service spec. It will notify you if it detects any errors.

For REST requests, you can change the parameter type on the Request page of the Request editor. However, the check will run against the data type defined in the specification. That is, the settings you set on the Request page will be ignored in this case.

Check Response Data

You validate data of JSON and XML responses. To do this, switch to the JSON or XML response page and select Validate from the context menu:

Validating response parameters

ReadyAPI will check if the response data structure corresponds to the structure defined in your API specification, and if the response values match the data type set in the specification. Note that if a response contains elements the specification does not define, the check algorithm does not consider this an error. The algorithm reports about an error if the response does not contain the needed elements, or if the property values do not match the element data types.

If needed, you can modify a response and then re-validate the response to make sure your changes are correct. To activate the Edit mode for a response, select Edit from the context menu on the JSON or XML page.

Supported Services

The described validation works for the following requests:

  • Requests of WSDL services.

  • Requests of the Swagger 2.0 services that match the following conditions:

    • The requests and responses pass data in the JSON format.
    • The service specification is in the JSON or YAML format.
    • The service specification was added to your project in ReadyAPI ver. 2.2 or later.

For other services, this check always succeeds.

See Also

Configuring Requests
Response tabs

Highlight search results