Should Link Relation Values describe linked resource only in the context of the current representation?

14 views
Skip to first unread message

albrikt a

unread,
Jun 17, 2014, 2:51:08 PM6/17/14
to restinp...@googlegroups.com

hi

1) pg. 103:

Link relation values help consumers understand why they might want to activate Hypermedia control.They do so by indicating the role of the linked resource in the context of current representation

 

a) I interpret "indicating the role of the linked resource in the context of current representation" as saying that link relation value LRV shouldn't give a general description of linked resource LR, but instead should always describe LR in the context of the current representation?

In other words, if two different representations both contained a link to the same resource R ( following link in first representation would GET R, while following link in second representation would update R ), then rel values in those two links should always be different?!

b) If LRV should indeed always describe LR in the context of current resource representation, then why do people recommend against documenting which HTTP verb to use with particular LRV?

Namely, while it somewhat makes sense that we shouldn't document what verb to use with with LRVs that indicate create/update action ( since in this case documenting the verb would prevent service from replacing, for example, POST with PUT and thus would cause tight coupling between a client and a service ), with LRVs that indicate other actions ( ie delete a resource, get a resource etc ) we always use same HTTP verbs ( and as such documenting what HTTP verb to use with particular LRV wouldn't cause tight coupling ), so why do some object to documenting HTTP verbs even for LRVs that will always use the same HTTP verb

Thank you

Ryan Wittibschlager

unread,
Sep 10, 2014, 9:27:23 AM9/10/14
to restinp...@googlegroups.com
Hi there,

I would also like to hear from an expert on this particular question. My guess is because we want to be consistent? Like you said, documenting the verb could prevent someone from replacing a POST with a PUT. Even though GETs and DELETEs are not generally replaced with another HTTP verb on consumer side, one might refrain from specifying these verbs in the LRV because we wouldn't do that for POSTs or PUTs, so let's be consistent and just not do it at all.

Those are my thoughts, I have no idea if that's really the reasoning behind it. I'd like to hear an expert's opinion on this :)
Reply all
Reply to author
Forward
0 new messages