ThunderClient_How to validate Json file all keys thats expected to be returning into the response body

111 views Asked by At

I'm using Thunder Client extension in VS code and trying to validate the JSON response body, Kind of array testing , Our test principle is to validate the JSON response body returning the correct property along with response.

{
  "data": {
    "count": 4,
    "rows": [
      {
        "id": 1,
        "name": "Sam",
        "code": "E101",
        "description": "default"
      }
       {
        "id": 2,
        "name": "Ram",
        "code": "E102",
        "description": "default"
      }
       {
        "id": 3,
        "name": "Sammy",
        "code": "E103",
        "description": "default"
      }
       {
        "id": 4,
        "name": "Tom",
        "code": "E104",
        "description": "default"
      }

Below is the screenshot of the tests was trying to validate presence of all keys of arrays are present or not

enter image description here

I've tried below scenario to validate IDs exists in the JSON and it works however failed to validate all keys available in the entire JSON.

enter image description here

0

There are 0 answers