Store api workaround no longer valid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapweb |
New
|
Undecided
|
Unassigned |
Bug Description
Due to an older bug (https:/
getAll (https:/
query := r.FormValue("q")
// This is a workaround until there is a way to get the list of snaps:
// https:/
if query == "" {
query = "."
}
This always worked because the store would ignore the ‘q’ parameter if a section parameter was also provided. However, a few weeks ago we started supporting searching for snaps within a section. This means that if both the ‘q’ and ‘section_name’ parameters are provided, the store will use the ‘q’ parameter to search within a section. Since ‘.’ does not match any snaps, this workaround is currently breaking snapweb.
In the case where the user is attempting to list the contents of a section, snapweb causes the following query to be sent to the store:
GET /api/v1/
To list snaps in a section, the correct API request should be:
GET /api/v1/
We will deploy a fix to the store to work around this issue in the short-term, but this workaround should be removed from snapweb as soon as possible. There is currently no case where setting ‘q’ to ‘.’ makes sense.
To list all the featured snaps, or to list the snaps in any other section, send:
GET /api/v1/
To list all the snaps in the store, send:
Header: 'X-Ubuntu-Store: ubuntu’
Header: ‘X-Ubuntu-Series: 16’
GET /api/v1/snaps
To search for snaps in the store, send:
/api/v1/
To search for snaps by name prefix in the store, send:
/api/v1/
To search for snaps within a specified section, send: /api/v1/