Page MenuHomePhabricator

Apply strict validation when constructing DataValue objects
Closed, ResolvedPublic


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:



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).

Related URL: (Gerrit Change I6990983ef0c0cad7c9d4f271bdf803902b94230b)

Related URL: (Gerrit Change I8916062971114d6bc3188dd4f0322c28cc54403e) (Gerrit Change I8916062971114d6bc3188dd4f0322c28cc54403e) | change APPROVED and MERGED [by jenkins-bot] (Gerrit Change I6990983ef0c0cad7c9d4f271bdf803902b94230b) | change ABANDONED [by Daniel Kinzler]

Related URL: (Gerrit Change I72d6b6d890718c07006c306c254479ce0789067e)

Related URL: (Gerrit Change I8286b6c1ce31be0d9cb1ccd34ea3a763d4fb223b)

Related URL: (Gerrit Change I1e2543c75f0407a22e531aac67ace9cf3f5670ae)

Related URL: (Gerrit Change I9920286723e04ba2005b608583c45338f53d21fd)

Related URL: (Gerrit Change Id27f19020e2fd75a250fea4deb1eb94aeeff6f3f)

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

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

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

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

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

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

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

Verified in Wikidata demo July 31th.