Re: ATOM representation of search result facets
Trygve Laugstøl <[email protected]>
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Aug 29, 2012 at 11:10:23PM -0600, Eric J. Bowman wrote:
> "Rushforth, Peter" wrote:
> >
> > As long as you don't use the application/atom+xml media type to
> > describe it, you should be OK.
> >
>
> You're not wrong, but I think there's a better way to look at it -- by
> staying true to the generic media type, rather than forking it to be a
> custom media type for one point of data. This can be done by extending
> Atom (which doesn't change the media type, i.e. it's still application/
> atom+xml), or perhaps just using an ugly hack like this:
>
> <link rel="related" title="Canon" type="application/atom+xml"
> href="/search?q=35mm&fq=Manufacturer%3DCanon...">length=134</link>
Given that Atom is XML and it and its extensions relies mostly on namespaces, I would consider using a custom attribute better way. Something like this:
<atom xmlns:foo="...">
<link rel="related" title="Canon" type="application/atom+xml"
foo:length="134"/>
> This just introduces some domain-specific vocabulary in the link text,
> without tripping up any generic Atom processors. To me this is far
> preferable to excluding generic Atom processors from the communication
> by introducing a new media type such processors won't recognize as
> something they can handle (not without sniffing, anyway).
I definitely agree with this. Atom is made to be extensible.
--
Trygve