As a developer of an application I want to specify which item fields I want to get from the API, so that I do not need to parse through unwanted fields
Allowed values of the _fields parameter:
- type
- labels
- descriptions
- aliases
- statements
- sitelinks
ID is always included in the response.
BDD
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
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
Not included in this story
- internationalized/translated error message via Accept-Language HTTP header
See Gerrit patch 770445 for the _fields parameter specification