Comment 2 for bug 1049374

Revision history for this message
Ian Booth (wallyworld) wrote :

What's returned is two lists - a list of branch resource entries and a list of bug resource entries. The items in these lists are serialised bug and branch entry resources. Because the result is not a homogeneous list of a single entry resource type, it's not possible to use an operation_returns_collection_of annotation.

Comparing the result of the getSharedArtifacts method as exists now, with another exported method which does return a heterogeneous list, the only difference I can see in what is returned is that the latter returns a json structure representing a batched result. For getSharedArtifacts, batching is not used.

So getSharedArtifacts returns:

[
{u'resource_type_link': u'http://api.launchpad.dev:8085/devel/#bug_task',
 u'self_link': u'http://api.launchpad.dev:8085/devel/product-name-100001/+bug/16',
 ....etc
 }]
[
{u'resource_type_link': u'http://api.launchpad.dev:8085/devel/#branch',
 u'http://api.launchpad.dev:8085/devel/~thundercat/product-name-100001/branch-100010',
...etc
}]

Compare this to for example IBug.getVisibleLinkedBranches:

{u'total_size': 1, u'start': 0,
 u'entries':
[{u'resource_type_link': u'http://api.launchpad.dev/devel/#bug_branch',
  u'self_link': u'http://api.launchpad.dev/devel/~person-name-100019/product-name-100023/branch-100020/+bug/16',
 ...etc
}]}

The latter has the extra batching attributes, but the format of the list entries is the same - serialised resource entries.

So I'm unsure what the bug is asking for. Yes, the data items in the result lists are dicts, but the items do correspond to a resource object type as can be seen from the above example output.