Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Be more specific with error message #171

Merged
merged 1 commit into from
Jul 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/JsonSchema/Constraints/CollectionConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public function check($value, $schema = null, $path = null, $i = null)
{
// Verify minItems
if (isset($schema->minItems) && count($value) < $schema->minItems) {
$this->addError($path, "There must be a minimum of " . $schema->minItems . " in the array");
$this->addError($path, "There must be a minimum of " . $schema->minItems . " items in the array");
}

// Verify maxItems
if (isset($schema->maxItems) && count($value) > $schema->maxItems) {
$this->addError($path, "There must be a maximum of " . $schema->maxItems . " in the array");
$this->addError($path, "There must be a maximum of " . $schema->maxItems . " items in the array");
}

// Verify uniqueItems
Expand Down Expand Up @@ -109,4 +109,4 @@ protected function validateItems($value, $schema = null, $path = null, $i = null
}
}
}
}
}