Skip to content

Commit 73254fb

Browse files
author
Allen Taylor
committed
Added a more descriptive error message when asserting against a JSON schema to ensure easier debugging
1 parent 8c25dd4 commit 73254fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Constraint/JsonValueMatchesSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function additionalFailureDescription($other): string
7070
$validator->check($other, $this->schema);
7171

7272
return implode("\n", array_map(function ($error) {
73-
return $error['message'];
73+
return sprintf("[%s] %s", $error['property'], $error['message']);
7474
}, $validator->getErrors()));
7575
}
7676

0 commit comments

Comments
 (0)