Last modified: 2014-07-31 17:43:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67607, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65607 - Empty objects can pass schemas with required fields
Empty objects can pass schemas with required fields
Status: NEW
Product: Analytics
Classification: Unclassified
EventLogging (Other open bugs)
unspecified
All All
: Low major
: ---
Assigned To: Nobody - You can work on this!
u=dandreescu@wikimedia.org c=EventLog...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-21 21:50 UTC by Matthew Flaschen
Modified: 2014-07-31 17:43 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Matthew Flaschen 2014-05-21 21:50:13 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).
Comment 1 Kevin Leduc 2014-07-31 17:43:39 UTC
Adjusting priority as this will not be fixed in the coming sprints.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links