Page MenuHomePhabricator

🚿️ Tidy up our use of ValidationError
Closed, ResolvedPublic

Description

In the past we've been abusing the "value" field of our ValidationError quite a bit. It used to always contain the exact value that failed the validation, but it now sometimes contains null, sometimes the limit of the validation. We recently introduced a flexible "context" field, which can be to store bad values or other context data.

Event Timeline

Change 853934 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] REST: Make ValidationError::getContext() not nullable

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

Change 853389 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] REST: Remove ValidationError::getValue()

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

Change 854013 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] REST: Replace ValidationError "source" with "code"

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

Change 853934 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Make ValidationError::getContext() not nullable

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

Change 853389 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Remove ValidationError::getValue()

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

Change 854013 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Replace ValidationError "source" with "code"

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