This step definition checks whether the API response is valid JSON. It helps confirm that the server returned structured JSON data instead of plain text, HTML, or invalid content.
Then (?:the response should be valid JSON|the API response should be valid JSON)$
Ensures the response body can be treated as JSON.
Example #1: Then the response should be valid JSON
Example #2: Then the API response should be valid JSON