Closed kaizirlewagen closed 3 years ago
I think https://github.com/Luracast/Restler/issues/659 is related and probably has todo with this commit https://github.com/Luracast/Restler/commit/c115e237129d611413b5658f469e61382a383d88.
In version 5 the file ValidationInfo.php does not have the === "problem". If i remove === check, the error is already there "Expecting integer value".
public static function numericValue($value)
{
return ( int )$value == $value
? ( int )$value
: floatval($value);
}
So, the choice problem does already exist.
The error occurres in Validator.php line 517.
switch ($info->type) {
case 'int' :
case 'float' :
case 'number' :
if (!is_numeric($input)) {
$error .= '. Expecting '
. ($info->type === 'int' ? 'integer' : 'numeric')
. ' value';
break;
}
Hope f2c365680ffb46466858a2961ab43bd05d999fb4 in v5 branch fixes this. Can you check?
@Arul- works perfect. Thx for your work !!!
I am using version 5.0.5
If i use a choice like this:
I get the following error:
Only if i select 0 (zero) through the choice. All other integer values are possible only 0 does not work. I need 0 (zero). If i use the empty value, this will be interpreted as 0 (zero).
How can i fix this?