Structure Validation

How to Verify the Entire Structure of an API Response in ContextQA

Validating the full structure of your API response helps ensure your data is consistent and reliable. Here’s how to quickly set up whole-object validation for your API response in ContextQA.

Run the API request and locate the result variable where your response is stored.

Image

Remove dynamic fields like `email` from the response body if you don’t want to validate them.

Name your expected value to keep your validations organized.

Add the entire response value for validation. Switch the value type to object since you’re comparing the whole object, not just a string.

Image

Click Create to set up your validation.

Image

If you want to double-check your response body, paste it into an online notepad to review the full structure.

Image

Execute your test case. Confirm it passes to ensure your API response matches the expected structure.

You’ve now validated the entire structure of your API response in just a few steps. This approach streamlines your QA process and helps catch unexpected changes in your response data.

Supporting Videoarrow-up-right

Last updated