Skip to content

Commit

Permalink
Fix wrong error reported when the value is smaller than the maximum.
Browse files Browse the repository at this point in the history
Can be tested with the following:

*Schema*
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://json-schema.org/draft-07/schema#",
  "description": "Representation of the core response to the front end",
  "type": "object",
  "required": ["testProperty"],
  "properties": {
    "testProperty": {
        "type": "integer",
        "minimum": 50,
        "maximum: 60
    }
  }
}


*JSON*
{
    "testProperty": 60
}
  • Loading branch information
iursevla authored Jun 26, 2018
1 parent 06186e5 commit b5aac5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ private function processNumeric($data, $path)
} else {
if ($data > $this->maximum) {
$this->fail(new NumericException(
'Value less than ' . $this->minimum . ' expected, ' . $data . ' received',
'Value less than ' . $this->maximum . ' expected, ' . $data . ' received',
NumericException::MAXIMUM), $path);
}
}
Expand Down

0 comments on commit b5aac5b

Please # to comment.