Last modified: 2013-07-23 21:13:34 UTC
The code that I took from EventLogging only allows arrays to contain one type of value. The "pages" property should allow for something like the following: [2, [5,8]] This would indicate that the section included pages 2, 5, 6, 7, 8. Right now the validation either allows only numbers, which would require the JSON to be formatted: [2, 5, 6, 7, 8] or only arrays, which would require the JSON to be formatted: [[2], [5,8]] Both of these seem a little silly, so it seems like it would be worth adjusting the code to allow for more than one type of value, and, ideally, pushing the changes back to EventLogging as well.
I'm not able to reproduce this; can you provide some additional details? Here's what I tried: $schema = array( 'properties' => array( 'collection' => array( 'type' => 'array', ), ) ); $obj = array( 'collection' => array( 8, "hello", array(6) ) ); var_dump ( efSchemaValidate( $obj, $schema ) ); // output: bool(true)
Sure. The schema that I am using is https://meta.wikimedia.org/wiki/Schema:BookManagerv2. The relevant bits are lines 179–199. Is this the incorrect way to indicate that an array should contain numbers or arrays of numbers? In your example, why is the string passing the validation?
The "Refactoring of Proofread Page extension" is working on a system to populate book pages with the <pages index> tags, and so we are stepping back from that feature. The "pages" property will be removed from the schema entirely.