Then the JSON response should have property "propertyPath"

This step definition is used to verify that a specific property exists in the JSON response. It’s useful when you want to check the presence of required fields without worrying about their values.

Then (?:the JSON response should have property|the API response should contain property) "([^"]*)"$

 

Checks that a specific key (or nested key) exists in the JSON response.

Example #1: Then the JSON response should have property "id"
Example #2: Then the API response should contain property "user.email"