Re: Is it correct to respond with partial representation for low capabilities media-types?

Jan Algermissen <[email protected]>
Newsgroups gmane.comp.web.services.rest
Message-ID <[email protected]>
Hi Philippe,



On Jun 5, 2012, at 4:38 AM, Philippe Rathé wrote:
> 
> Are there any rules to follow when deciding to NOT include a specific
> part of a representation for a specific media-type? Like: "If the
> media-type can honor it you must include it"? Or judgment and best
> effort is enough?

This is actually a fascinating question, IMHO.

You can reformulate a bit and ask: "Given the usual flexibility (optionality of most elements) in well designed media types, how does a server developer know what a correct response body looks like. An Atom <feed/> is a correct response from the POV of the media type spec, but we would consider a blog server to be broken if it responded like this all the time.

Looking a the application the client intends to create (the use case realized by the user agent) is not an option because in a RESTful system the server does not (and must not) know the application the client is trying to walk through.

All the server developer really has is the media type spec of the media type it is going to serve.

So, how does Joe-server developer know what to implement (or what he is allowed to change when altering the implementation of an existing service)?


The solution to the 'problem' is that the server developer's task is not to implement something useless, but to expose the capabilities of the server side component in a way that provides a benefit to the client, in a way that is useful. You could add: in a way that maximizes re-usability.

These things are what lead the server developer during implementation.

Interestingly, this is not different from RPC systems, because a service that always responds to

service.getPendingOrders()

with an empty list surely honors the interface spec, but would still be broken in the same way as the <feed/>-responding server would be.

Hence the short answer is "common sense" :-)

Jan




> 
> - Philippe
> 



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/rest-discuss/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/rest-discuss/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.