thephpleague / json-guard

Validation of json-schema.org compliant schemas.
http://json-guard.thephpleague.com/
MIT License
175 stars 26 forks source link

String Validator for digits greater than PHP_INT_MAX doesn't work #119

Closed galoppi closed 7 years ago

galoppi commented 7 years ago

The rule

"telephone": 
{
   "type": "string"
}

doesn't validate for

{
   "telephone":"12372163870"
}

even though "telephone" is of type string in JSON string. @see: vendor/league/json-guard/src/Constraints/Type.php:56

Why do you do this check here? Shouldn't this check be done for type int instead of string?

json_decode($this->request->getRawBody(), false, 512, JSON_BIGINT_AS_STRING) doesn't change the behaviour.

matt-allan commented 7 years ago

Which version do you have installed? This should be fixed in 1.0.1.

galoppi commented 7 years ago

Oh, I see, yeah, with 1.0.1 it works. Sorry!