Last modified: 2014-07-31 17:43:39 UTC
I found this while testing the fix for bug 65385, but it's a distinct (and more serious) issue. Blank objects can pass schemas with required fields. To test, run the following in phpsh: --- $schema = array( 'properties' => array( 'someRequiredField' => array( 'type' => 'string', 'required' => true ) ) ); var_export( efSchemaValidate( array(), $schema ) ); var_export( efSchemaValidate( array( 'a' => 'b' ), $schema ) ); --- The first passes, which is the bug. The second throws: Missing required field "someRequiredField" as expected (It is also invalid for an additional reason, the extra property, but there is no issue, since it fails it for one of the correct reasons).
Adjusting priority as this will not be fixed in the coming sprints.