From b5aac5b69dc39d9c422968e68707f0883afc2631 Mon Sep 17 00:00:00 2001 From: Rui Alves Date: Tue, 26 Jun 2018 17:47:45 +0100 Subject: [PATCH] Fix wrong error reported when the value is smaller than the maximum. 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 } --- src/Schema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Schema.php b/src/Schema.php index 9b982e5..f74c26e 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -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); } }