Field specification should be consistent across all API endpoints

Bug #1525914 reported by John Lenton on 2015-12-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Click Package Index
High
Unassigned

Bug Description

The `api/v1/search` endpoint allows the user to specify which fields should be returned in results by way of the `fields` request parameter. This is not currently the case for any of the other API endpoints, but it should be.

In addition, several endpoints embed multiple resource types in their responses, e.g. `api/v1/search` embeds `clickindex:package` and `clickindex:recommendation`. It would be good to be able to control the fields returned in each embedded type individually, for example:

    GET /api/v1/search?fields=name,title&package.fields=name,title,prices

Would return the `name` and `title` fields by default, except for embedded `clickindex:package` resources, which would return `name`, `title` and `prices` fields. Perhaps this could be condensed so that `fields` specifies the common fields for all embedded resources, and individual resource field specifiers are additions to that list:

    GET /api/v1/search?fields=name,title&package.fields=prices

James Tait (jamestait) on 2015-12-14
summary: - It would be nice if the `click-metadata` endpoint took `fields` as well.
+ Field specification should be consistent across all API endpoints
James Tait (jamestait) on 2015-12-14
description: updated
Changed in click-package-index:
status: New → Confirmed
importance: Undecided → High
James Tait (jamestait) on 2016-01-12
Changed in click-package-index:
assignee: nobody → James Tait (jamestait)
status: Confirmed → In Progress
James Tait (jamestait) on 2016-02-02
Changed in click-package-index:
status: In Progress → Triaged
assignee: James Tait (jamestait) → nobody
Wojciech (wojaugustow) on 2016-02-02
Changed in click-package-index:
status: Triaged → Fix Released
James Tait (jamestait) on 2016-04-20
Changed in click-package-index:
status: Fix Released → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers