Then the API response should contain json:

This step definition is used to verify that the API response body contains specific JSON data. It allows you to check that certain keys and values exist in the response, without needing to match the entire JSON exactly.

Then (?:the )?API response should contain json:$

 

Checks that the response from the last API request includes all the key–value pairs specified in the provided JSON.

Example:

Then the API response should contain json:
 """
 {
   "name": "John Doe",
   "email": "john@example.com"
 }
 """