Skip to content

Commit c0387d3

Browse files
committed
Merge pull request #150 from hhamon/better-error-message
[Constraints] make error messages better.
2 parents 35c5435 + 65c4134 commit c0387d3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/JsonSchema/Constraints/ObjectConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function validateElement($element, $matches, $objectDefinition = null, $p
7777

7878
// no additional properties allowed
7979
if (!in_array($i, $matches) && $additionalProp === false && $this->inlineSchemaProperty !== $i && !$definition) {
80-
$this->addError($path, "The property " . $i . " is not defined and the definition does not allow additional properties");
80+
$this->addError($path, "The property - " . $i . " - is not defined and the definition does not allow additional properties");
8181
}
8282

8383
// additional properties defined

tests/JsonSchema/Tests/Constraints/AdditionalPropertiesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getInvalidTests()
3636
array(
3737
array(
3838
'property' => '',
39-
'message' => 'The property additionalProp is not defined and the definition does not allow additional properties'
39+
'message' => 'The property - additionalProp - is not defined and the definition does not allow additional properties'
4040
)
4141
)
4242
),

0 commit comments

Comments
 (0)