Merge pull request #150 from hhamon/better-error-message

[Constraints] make error messages better.
This commit is contained in:
David Porter 2015-06-10 20:44:25 -05:00
commit c0387d3f58
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ class ObjectConstraint extends Constraint
// no additional properties allowed
if (!in_array($i, $matches) && $additionalProp === false && $this->inlineSchemaProperty !== $i && !$definition) {
$this->addError($path, "The property " . $i . " is not defined and the definition does not allow additional properties");
$this->addError($path, "The property - " . $i . " - is not defined and the definition does not allow additional properties");
}
// additional properties defined

View File

@ -36,7 +36,7 @@ class AdditionalPropertiesTest extends BaseTestCase
array(
array(
'property' => '',
'message' => 'The property additionalProp is not defined and the definition does not allow additional properties'
'message' => 'The property - additionalProp - is not defined and the definition does not allow additional properties'
)
)
),