[rest-practices] Atom as a generic container? [was Re: Media types]
Bryan Kearney
bkearney at redhat.com
Fri Apr 16 12:46:27 UTC 2010
On 04/16/2010 08:40 AM, Mark McLoughlin wrote:
> On Fri, 2010-04-16 at 08:06 -0400, Bryan Kearney wrote:
>> On 04/16/2010 05:22 AM, Mark McLoughlin wrote:
>>> On Thu, 2010-04-15 at 08:44 -0400, Bill Burke wrote:
>>>
>>>> > application/vnd.rht.rhevm.vm+xml;version=1
>>>> > application/vnd.rht.rhevm.host+xml;version=1
>>>> > application/vnd.rht.rhevm.collection.vm+xml;version=1
>>>> > application/vnd.rht.rhevm.collection.host+xml;version=1
>>>> >
>>>>
>>>> IMO, the above two are ok. Atom does it!
>>>
>>> Okay, you're going to need to help me out here :-)
>>>
>>> We're talking about the format of the document returned by e.g.
>>> 'GET /vms'. At the moment, we're just doing:
>>>
>>> <collection>
>>> <vm>
>>> </vm>
>>> ...
>>> </collection>
>>
>>
>> I think an xml structure like this will make it harder for any
>> auto-clients such as ruby. I would suggest to get<vms/> as the wrapper.
>
> Yeah,<collection/> is just the JAX-B default from List<VM>
>
> I was tending towards<vms/> anyway, but this auto-clients business
> sounds like an actual concrete reason for it ... I'll have to take a
> look at that :)
We use RESEasy as the server, and I have a small rails app using
ActiveResource to test consumers which try and auto-serialize. It is not
Hateoas, but it is instructive.
-- bk
More information about the rest-practices
mailing list