API Design Questions

Gervase Markham gerv at mozilla.org
Wed Sep 23 11:14:13 UTC 2009


Here are some things I've run into when designing the RESTful API. 
Perhaps people could tell me what they think the best option is.

Attachments
-----------

The current design uses URLs of the form:
/bug/<bugid>/attachment/<attachid>

However, attachids are globally unique, not per-bug unique. And this URL 
form means you need to know the bug number before you can access the 
attachment, which seems unnecessary (or it would mean the API just 
ignored the bug number, which seems somewhat dumb too). If all you have 
is e.g. a standard attachment URL, you don't have the bug number.

So should I change it to use URLs simply of the form
/attachment/<attachid>

?

Comments
--------

A similar question arises with comments, where the comment IDs used on 
the interface are globally unique. Do you think people would prefer to 
access individual comments using URIs like:
/bug/<bugid>/comment/0
/bug/<bugid>/comment/3
(i.e. indexed by count in the bug, as you might get from 
"show_bug.cgi?id=123456#45")

or like

/comment/13535
/comment/43487

? I think the former (i.e. different from the attachments case), but I'd 
be interested in the opinions of others. But if we do use the former, 
what do we do with the globally-unique comment IDs? Suppress them 
because they'd cause confusion?

Gerv



_______________________________________________
dev-apps-bugzilla mailing list
dev-apps-bugzilla at lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-apps-bugzilla



More information about the developers mailing list