Page MenuHomePhabricator

Apply strict validation when constructing DataValue objects
Closed, ResolvedPublic

Description

DataValue objects should perform strict validation on the parameters they receive in their constructor, and throw well defined and informative exceptions when validation fails.

The API needs to catch these exceptions and turn them into an appropriate API error response.


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=49433

Details

Reference
bz49264

Event Timeline

• bzimport raised the priority of this task from to High.Nov 22 2014, 1:56 AM
• bzimport set Reference to bz49264.
• bzimport added a subscriber: Unknown Object (MLST).

https://gerrit.wikimedia.org/r/68150 (Gerrit Change I891606) | change APPROVED and MERGED [by jenkins-bot]

Change 68952 abandoned by Daniel Kinzler:
(bug 49264) Handle corrupt data values gracefully.

Reason:
Use I992028 instead. It seems that handling bad values on the DataValue level is less awkward.

https://gerrit.wikimedia.org/r/68952

Change 70433 merged by Jeroen De Dauw:
(bug 49264) Handle bad values using UnDeserializableValue.

https://gerrit.wikimedia.org/r/70433

Change 68152 merged by jenkins-bot:
(bug 49264, bug 48965) validate time format.

https://gerrit.wikimedia.org/r/68152

Change 70443 merged by jenkins-bot:
(bug 49264) Handle UnDeserializableValue gracefully.

https://gerrit.wikimedia.org/r/70443

Change 68002 merged by jenkins-bot:
(bug 49264) Handle UnDeserializableValue gracefully.

https://gerrit.wikimedia.org/r/68002

Change 69659 merged by jenkins-bot:
(bug 49264) Make SnakValidator fail on bad values.

https://gerrit.wikimedia.org/r/69659

Verified in Wikidata demo July 31th.