Link relation granularity vs precision in a custom media type?

48 views
Skip to first unread message

The Amiable API

unread,
Feb 27, 2012, 3:57:52 PM2/27/12
to API Craft

javier ramirez

unread,
Feb 27, 2012, 7:18:30 PM2/27/12
to api-...@googlegroups.com
Hi,

http://stackoverflow.com/questions/9466559/link-relation-granularity-vs-precision-in-a-custom-media-type


In order to make my API as usable as possible, I am trying to make it self-documented where it makes sense. The methods you can invoke on a given linked resource is one of the things I am including.
 
The approach I am taking, and I could be totally wrong here, is adding a "methods" attribute to my links, so I have a rel (that would be "self" in this particular case), an uri to the resource and a methods attribute that looks something like "POST,DELETE", or "GET" or "GET,PUT,DELETE", depending on the transitions available.

Hopefully, when a developer gets a response from my API, it will be easy to guess what can be done with each of the linked resources, including self.

Cheers,

j

Reply all
Reply to author
Forward
0 new messages