Page MenuHomePhabricator

🟧 Filter item data by input from the _fields request parameter
Closed, ResolvedPublic

Description

WHEN I request GET /entities/items/{item_id}
AND provide the _fields parameter containing allowed field names
THEN I get 200 HTTP response
AND response contains serialization of the item data following the specification, including ID and only the fields I have requested
AND headers of the response include the headers as defined in the specification

Task Breakdown Notes:

  • in the RouteHandler, construct the GetItemRequest object based on both the ItemId and the _fields request parameter
  • in the GetItem use case, filter the itemSerialization based on the _fields from the GetItemRequest
    • create a new GetItemFieldsFilter object that filters the itemSerialization based on requested fields
  • since it is an array, the filtered ItemSerialization can still be passed into GetItemResult

Event Timeline

Silvan_WMDE renamed this task from Filter item data by input from the _fields request parameter to 🟧 Filter item data by input from the _fields request parameter.Mar 16 2022, 9:27 AM
Silvan_WMDE created this task.

Change 772804 had a related patch set uploaded (by Ollie Shotton; author: Ollie Shotton):

[mediawiki/extensions/Wikibase@master] REST: Filter item response via _fields query param

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

Change 772804 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Filter item response via _fields query param

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

WMDE-leszek claimed this task.