You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Array validation for a given type, in this example integer fails with PHP internal error exception being thrown if a client supplies an array with an object element in it.
This seems to be the case for string type as well, so I'd assume that this is a more common issue across all types of constraints.
String Exception PhpErrorException Exception; Code: internalError; Message: mb_detect_encoding() expects parameter 1 to be string, object given; File: .../justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php; Line: 54;
Integer Exception PhpErrorException Exception; Code: internalError; Message: Object of class stdClass could not be converted to int; File: .../justinrainbow/json-schema/src/JsonSchema/Constraints/NumberConstraint.php; Line: 38;
The text was updated successfully, but these errors were encountered:
OneEyedSpaceFish
changed the title
Type casting results in internal error exception when object type is given
Type casting results in PHP error exception when object type is given
Jan 25, 2019
@OneEyedSpaceFish in an attempt to cleanup this repo we are trying to filter the issues and see which ones might be closed. Is it still something worth pursuing, could you provide with a bit more detailed reproduction steps perhaps? Or is this is a rather old issue, which sadly was left unanswered, and can be closed? Feel free to close it yourself with some comments if helpful.
Array validation for a given type, in this example
integer
fails with PHP internal error exception being thrown if a client supplies an array with an object element in it.This seems to be the case for
string
type as well, so I'd assume that this is a more common issue across all types of constraints.JSON body:
[{}]
Integer example:
Schema
String Exception
PhpErrorException Exception; Code: internalError; Message: mb_detect_encoding() expects parameter 1 to be string, object given; File: .../justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php; Line: 54;
Integer Exception
PhpErrorException Exception; Code: internalError; Message: Object of class stdClass could not be converted to int; File: .../justinrainbow/json-schema/src/JsonSchema/Constraints/NumberConstraint.php; Line: 38;
Versions affected: v5.2.8, v5.2.7, v5.2.6 (possibly more)
The text was updated successfully, but these errors were encountered: