Then the JSON response should not have property "propertyPath"

This step definition is used to verify that a specific property does not exist in the JSON response. It’s helpful for checking that sensitive or unnecessary fields (like passwords or secrets) are not included in the response.

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

 

Checks that a specific key (or nested key) is absent from the JSON response.

Example #1: Then the JSON response should not have property "password"
Example #2: Then the API response should not contain property "secret"