mirror of
https://github.com/justinrainbow/json-schema.git
synced 2025-05-06 06:25:23 +02:00
Merge pull request #150 from hhamon/better-error-message
[Constraints] make error messages better.
This commit is contained in:
commit
c0387d3f58
@ -77,7 +77,7 @@ class ObjectConstraint extends Constraint
|
|||||||
|
|
||||||
// no additional properties allowed
|
// no additional properties allowed
|
||||||
if (!in_array($i, $matches) && $additionalProp === false && $this->inlineSchemaProperty !== $i && !$definition) {
|
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
|
// additional properties defined
|
||||||
|
@ -36,7 +36,7 @@ class AdditionalPropertiesTest extends BaseTestCase
|
|||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
'property' => '',
|
'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'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user