api should have collections for relevant bugs

Bug #711718 reported by Martin Pool
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

At the moment to find bugs you must almost always pick a random IHasBugs and then call searchTasks() on it. This works, but is un-restful, not super discoverable, and inconsistent with the rest of the api. It would be good if you could instead say:

  user.affecting_open_bugs_collection_link
  project.open_bugs_collection_link

etc.

For more complicated things you may want to do a search. If https://dev.launchpad.net/LEP/WebservicePerformance is implemented this would fit nicely with its 'restriction' concept, but it would be useful even today.

At the moment these collections exist but are done in the view not the model.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 711718] [NEW] api should have collections for relevant bugs

Why do you say its unrestful?

Revision history for this message
Martin Pool (mbp) wrote :

Primarily 1- http://en.wikipedia.org/wiki/HATEOAS (great acronym)

> The HATEOAS constraint is an acronym for Hypermedia as the Engine of Application State. This principle is the key differentiator between a REST and most other forms of client server system. Rather than the actions and interfaces a client may use being defined elsewhere, such as in a WSDL file or predefined in the client code, the principle is that the hypermedia in each server response will contain links that correspond to all the actions that the client can currently perform.

So in this case it would be better for eg the person object to point to its assigned bugs, rather than you needing to know you can call a method on the person.

2- Calling a method when a collection link would do just as well is more like rpc than rest.

3- It's inconsistent with the namespace space exposed through the web ui, eg <https://bugs.launchpad.net/~mbp/+assignedbugs>, and generally correspondence is seen as useful in rest.

William Grant (wgrant)
tags: added: bug-search
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.