You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we use $I->seeResponseIsValidOnJsonSchemaString, and the assertion fails, we get an error like this:
Step See response is valid on json schema string "{"type":"object","properties":{"error":{"type":"string"},"client":{"type":["string","number","null"]},"state":{"type":"null"},"message":{"type":["string","null"]},"int..."
Fail String value found, but a null is required
Failed asserting that false is true.
This is very confusing and hard to debug because it doesn't tell us exactly which property failed the assertion. When we have a giant schema, figuring that out by hand is a real pain.
It would be fantastic if the error message could be improved to mention which property (or path to the property if deeply nested) failed the assertion.
When we use
$I->seeResponseIsValidOnJsonSchemaString
, and the assertion fails, we get an error like this:This is very confusing and hard to debug because it doesn't tell us exactly which property failed the assertion. When we have a giant schema, figuring that out by hand is a real pain.
It would be fantastic if the error message could be improved to mention which property (or path to the property if deeply nested) failed the assertion.
It looks like https://github.com/jsonrainbow/json-schema is being used under the hood, right now the error message is just taking the
"message"
from the validator:module-rest/src/Codeception/Module/REST.php
Lines 961 to 966 in f24db25
According to the validator package's README,
getErrors()
also returns the property that failed. It gives an example like this:Could we update the error message for this assertion, please?
The text was updated successfully, but these errors were encountered: