Page MenuHomePhabricator

🟧 Handle error when `_fields` parameter includes an invalid value
Closed, ResolvedPublic


WHEN I request GET /entities/items/{item_id}
AND provide the _fields parameter including the value which is not allowed
THEN I get 400 HTTP response
AND it contains a invalid-field code and a message "Not a valid field: {field}"
AND a HTTP header Content-Language set to en


  • use the validator to return a "failure" GetItemResult (with isSuccessful() == false)
  • the RouteHandler will create an error response (set http status, code, message) based on the GetItemResult

Event Timeline

Change 773790 had a related patch set uploaded (by Silvan Heintze; author: Silvan Heintze):

[mediawiki/extensions/Wikibase@master] REST: Validate _fields parameter

Change 773790 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Validate _fields parameter

WMDE-leszek claimed this task.