You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by Chris Geer <ch...@cxtsoftware.com> on 2013/06/12 22:58:33 UTC

XML vs JSON

All, I've been working on the web services and something that I think we
need to implement is being able to return reduced data sets. For example,
if you get a list of people it should contain some less information for
each person than if you got a single person. There is a really easy way to
handle this in JSON using the @JSONView annotation from Jackson. It's a
little tricker with XML but do-able as well.

I'm of the opinion that we could get away with only returning JSON but what
does everyone else think?

Chris

Re: XML vs JSON

Posted by Chris Geer <ch...@cxtsoftware.com>.
Sorry, no go-backs.

J/K, see my response in your other thread.


On Thu, Jul 11, 2013 at 1:23 PM, Erin Noe-Payne <er...@gmail.com>wrote:

> Chris, after thinking about this more carefully, I believe that any
> list endpoint should return a full representation of the object.
> Endpoints should support a ?fields query string parameter to allow
> partial representation as needed. I've outlined this in my recent
> proposal for the rest api interface - we can continue discussion
> there.
>
> On Mon, Jul 8, 2013 at 11:57 AM, Erin Noe-Payne
> <er...@gmail.com> wrote:
> > Correct.
> >
> > On Sun, Jul 7, 2013 at 11:58 PM, Chris Geer <ch...@cxtsoftware.com>
> wrote:
> >> On Sun, Jul 7, 2013 at 2:21 PM, Erin Noe-Payne <
> erin.noe.payne@gmail.com>wrote:
> >>
> >>> For individual resources angular will expect json objects, for any
> >>> query or list results, angular would expect an array of objects. It
> >>> does not necessarily care if those objects are partial representations
> >>> - that's more about our architecture and balancing # of requests on a
> >>> page vs weight of data we deliver. Does that answer your question?
> >>>
> >>
> >> Just to make sure, for example, if you requested a .../people/ and got
> >>
> >> [{ "id": 1, "name": "Bob"}, { "id": 2, "name": "Sue"}]
> >>
> >> but when you requested ../people/1 you got
> >>
> >> { "id": 1, "name": "Bob", "email": "bob@bob.com"...}
> >>
> >> it would be ok. i.e the full object at /people/1 doesn't match the
> object
> >> in the list at /people/
> >>
> >>>
> >>> On Sun, Jul 7, 2013 at 4:36 PM, Chris Geer <ch...@cxtsoftware.com>
> wrote:
> >>> > Sorry to bring this topic back up but I wanted to make sure the
> JSONView
> >>> > approach will work with the Angular branch. Erin, when angular hits
> the
> >>> web
> >>> > service, does it expect the GET on the resource list to return the
> full
> >>> > objects? Or can it get the full objects individually? The idea is
> that
> >>> the
> >>> > list would return a subset of the data (i.e. no need to return every
> >>> detail
> >>> > about every person when you just want a list of people).
> >>> >
> >>> > Chris
> >>> >
> >>> >
> >>> > On Thu, Jun 13, 2013 at 7:21 AM, Matt Franklin <
> m.ben.franklin@gmail.com
> >>> >wrote:
> >>> >
> >>> >> On Wed, Jun 12, 2013 at 5:31 PM, Erin Noe-Payne <
> >>> erin.noe.payne@gmail.com
> >>> >> >wrote:
> >>> >>
> >>> >> > I believe we are only interested in JSON.
> >>> >> >
> >>> >>
> >>> >> JSON is critical.  XML would be nice to have if we can do it though.
> >>> >>
> >>> >>
> >>> >> >
> >>> >> > On Wed, Jun 12, 2013 at 4:58 PM, Chris Geer <
> chris@cxtsoftware.com>
> >>> >> wrote:
> >>> >> > > All, I've been working on the web services and something that I
> >>> think
> >>> >> we
> >>> >> > > need to implement is being able to return reduced data sets. For
> >>> >> example,
> >>> >> > > if you get a list of people it should contain some less
> information
> >>> for
> >>> >> > > each person than if you got a single person. There is a really
> easy
> >>> way
> >>> >> > to
> >>> >> > > handle this in JSON using the @JSONView annotation from Jackson.
> >>> It's a
> >>> >> > > little tricker with XML but do-able as well.
> >>> >> > >
> >>> >> > > I'm of the opinion that we could get away with only returning
> JSON
> >>> but
> >>> >> > what
> >>> >> > > does everyone else think?
> >>> >> > >
> >>> >> > > Chris
> >>> >> >
> >>> >>
> >>>
>

Re: XML vs JSON

Posted by Erin Noe-Payne <er...@gmail.com>.
Chris, after thinking about this more carefully, I believe that any
list endpoint should return a full representation of the object.
Endpoints should support a ?fields query string parameter to allow
partial representation as needed. I've outlined this in my recent
proposal for the rest api interface - we can continue discussion
there.

On Mon, Jul 8, 2013 at 11:57 AM, Erin Noe-Payne
<er...@gmail.com> wrote:
> Correct.
>
> On Sun, Jul 7, 2013 at 11:58 PM, Chris Geer <ch...@cxtsoftware.com> wrote:
>> On Sun, Jul 7, 2013 at 2:21 PM, Erin Noe-Payne <er...@gmail.com>wrote:
>>
>>> For individual resources angular will expect json objects, for any
>>> query or list results, angular would expect an array of objects. It
>>> does not necessarily care if those objects are partial representations
>>> - that's more about our architecture and balancing # of requests on a
>>> page vs weight of data we deliver. Does that answer your question?
>>>
>>
>> Just to make sure, for example, if you requested a .../people/ and got
>>
>> [{ "id": 1, "name": "Bob"}, { "id": 2, "name": "Sue"}]
>>
>> but when you requested ../people/1 you got
>>
>> { "id": 1, "name": "Bob", "email": "bob@bob.com"...}
>>
>> it would be ok. i.e the full object at /people/1 doesn't match the object
>> in the list at /people/
>>
>>>
>>> On Sun, Jul 7, 2013 at 4:36 PM, Chris Geer <ch...@cxtsoftware.com> wrote:
>>> > Sorry to bring this topic back up but I wanted to make sure the JSONView
>>> > approach will work with the Angular branch. Erin, when angular hits the
>>> web
>>> > service, does it expect the GET on the resource list to return the full
>>> > objects? Or can it get the full objects individually? The idea is that
>>> the
>>> > list would return a subset of the data (i.e. no need to return every
>>> detail
>>> > about every person when you just want a list of people).
>>> >
>>> > Chris
>>> >
>>> >
>>> > On Thu, Jun 13, 2013 at 7:21 AM, Matt Franklin <m.ben.franklin@gmail.com
>>> >wrote:
>>> >
>>> >> On Wed, Jun 12, 2013 at 5:31 PM, Erin Noe-Payne <
>>> erin.noe.payne@gmail.com
>>> >> >wrote:
>>> >>
>>> >> > I believe we are only interested in JSON.
>>> >> >
>>> >>
>>> >> JSON is critical.  XML would be nice to have if we can do it though.
>>> >>
>>> >>
>>> >> >
>>> >> > On Wed, Jun 12, 2013 at 4:58 PM, Chris Geer <ch...@cxtsoftware.com>
>>> >> wrote:
>>> >> > > All, I've been working on the web services and something that I
>>> think
>>> >> we
>>> >> > > need to implement is being able to return reduced data sets. For
>>> >> example,
>>> >> > > if you get a list of people it should contain some less information
>>> for
>>> >> > > each person than if you got a single person. There is a really easy
>>> way
>>> >> > to
>>> >> > > handle this in JSON using the @JSONView annotation from Jackson.
>>> It's a
>>> >> > > little tricker with XML but do-able as well.
>>> >> > >
>>> >> > > I'm of the opinion that we could get away with only returning JSON
>>> but
>>> >> > what
>>> >> > > does everyone else think?
>>> >> > >
>>> >> > > Chris
>>> >> >
>>> >>
>>>

Re: XML vs JSON

Posted by Erin Noe-Payne <er...@gmail.com>.
Correct.

On Sun, Jul 7, 2013 at 11:58 PM, Chris Geer <ch...@cxtsoftware.com> wrote:
> On Sun, Jul 7, 2013 at 2:21 PM, Erin Noe-Payne <er...@gmail.com>wrote:
>
>> For individual resources angular will expect json objects, for any
>> query or list results, angular would expect an array of objects. It
>> does not necessarily care if those objects are partial representations
>> - that's more about our architecture and balancing # of requests on a
>> page vs weight of data we deliver. Does that answer your question?
>>
>
> Just to make sure, for example, if you requested a .../people/ and got
>
> [{ "id": 1, "name": "Bob"}, { "id": 2, "name": "Sue"}]
>
> but when you requested ../people/1 you got
>
> { "id": 1, "name": "Bob", "email": "bob@bob.com"...}
>
> it would be ok. i.e the full object at /people/1 doesn't match the object
> in the list at /people/
>
>>
>> On Sun, Jul 7, 2013 at 4:36 PM, Chris Geer <ch...@cxtsoftware.com> wrote:
>> > Sorry to bring this topic back up but I wanted to make sure the JSONView
>> > approach will work with the Angular branch. Erin, when angular hits the
>> web
>> > service, does it expect the GET on the resource list to return the full
>> > objects? Or can it get the full objects individually? The idea is that
>> the
>> > list would return a subset of the data (i.e. no need to return every
>> detail
>> > about every person when you just want a list of people).
>> >
>> > Chris
>> >
>> >
>> > On Thu, Jun 13, 2013 at 7:21 AM, Matt Franklin <m.ben.franklin@gmail.com
>> >wrote:
>> >
>> >> On Wed, Jun 12, 2013 at 5:31 PM, Erin Noe-Payne <
>> erin.noe.payne@gmail.com
>> >> >wrote:
>> >>
>> >> > I believe we are only interested in JSON.
>> >> >
>> >>
>> >> JSON is critical.  XML would be nice to have if we can do it though.
>> >>
>> >>
>> >> >
>> >> > On Wed, Jun 12, 2013 at 4:58 PM, Chris Geer <ch...@cxtsoftware.com>
>> >> wrote:
>> >> > > All, I've been working on the web services and something that I
>> think
>> >> we
>> >> > > need to implement is being able to return reduced data sets. For
>> >> example,
>> >> > > if you get a list of people it should contain some less information
>> for
>> >> > > each person than if you got a single person. There is a really easy
>> way
>> >> > to
>> >> > > handle this in JSON using the @JSONView annotation from Jackson.
>> It's a
>> >> > > little tricker with XML but do-able as well.
>> >> > >
>> >> > > I'm of the opinion that we could get away with only returning JSON
>> but
>> >> > what
>> >> > > does everyone else think?
>> >> > >
>> >> > > Chris
>> >> >
>> >>
>>

Re: XML vs JSON

Posted by Chris Geer <ch...@cxtsoftware.com>.
On Sun, Jul 7, 2013 at 2:21 PM, Erin Noe-Payne <er...@gmail.com>wrote:

> For individual resources angular will expect json objects, for any
> query or list results, angular would expect an array of objects. It
> does not necessarily care if those objects are partial representations
> - that's more about our architecture and balancing # of requests on a
> page vs weight of data we deliver. Does that answer your question?
>

Just to make sure, for example, if you requested a .../people/ and got

[{ "id": 1, "name": "Bob"}, { "id": 2, "name": "Sue"}]

but when you requested ../people/1 you got

{ "id": 1, "name": "Bob", "email": "bob@bob.com"...}

it would be ok. i.e the full object at /people/1 doesn't match the object
in the list at /people/

>
> On Sun, Jul 7, 2013 at 4:36 PM, Chris Geer <ch...@cxtsoftware.com> wrote:
> > Sorry to bring this topic back up but I wanted to make sure the JSONView
> > approach will work with the Angular branch. Erin, when angular hits the
> web
> > service, does it expect the GET on the resource list to return the full
> > objects? Or can it get the full objects individually? The idea is that
> the
> > list would return a subset of the data (i.e. no need to return every
> detail
> > about every person when you just want a list of people).
> >
> > Chris
> >
> >
> > On Thu, Jun 13, 2013 at 7:21 AM, Matt Franklin <m.ben.franklin@gmail.com
> >wrote:
> >
> >> On Wed, Jun 12, 2013 at 5:31 PM, Erin Noe-Payne <
> erin.noe.payne@gmail.com
> >> >wrote:
> >>
> >> > I believe we are only interested in JSON.
> >> >
> >>
> >> JSON is critical.  XML would be nice to have if we can do it though.
> >>
> >>
> >> >
> >> > On Wed, Jun 12, 2013 at 4:58 PM, Chris Geer <ch...@cxtsoftware.com>
> >> wrote:
> >> > > All, I've been working on the web services and something that I
> think
> >> we
> >> > > need to implement is being able to return reduced data sets. For
> >> example,
> >> > > if you get a list of people it should contain some less information
> for
> >> > > each person than if you got a single person. There is a really easy
> way
> >> > to
> >> > > handle this in JSON using the @JSONView annotation from Jackson.
> It's a
> >> > > little tricker with XML but do-able as well.
> >> > >
> >> > > I'm of the opinion that we could get away with only returning JSON
> but
> >> > what
> >> > > does everyone else think?
> >> > >
> >> > > Chris
> >> >
> >>
>

Re: XML vs JSON

Posted by Erin Noe-Payne <er...@gmail.com>.
For individual resources angular will expect json objects, for any
query or list results, angular would expect an array of objects. It
does not necessarily care if those objects are partial representations
- that's more about our architecture and balancing # of requests on a
page vs weight of data we deliver. Does that answer your question?

On Sun, Jul 7, 2013 at 4:36 PM, Chris Geer <ch...@cxtsoftware.com> wrote:
> Sorry to bring this topic back up but I wanted to make sure the JSONView
> approach will work with the Angular branch. Erin, when angular hits the web
> service, does it expect the GET on the resource list to return the full
> objects? Or can it get the full objects individually? The idea is that the
> list would return a subset of the data (i.e. no need to return every detail
> about every person when you just want a list of people).
>
> Chris
>
>
> On Thu, Jun 13, 2013 at 7:21 AM, Matt Franklin <m....@gmail.com>wrote:
>
>> On Wed, Jun 12, 2013 at 5:31 PM, Erin Noe-Payne <erin.noe.payne@gmail.com
>> >wrote:
>>
>> > I believe we are only interested in JSON.
>> >
>>
>> JSON is critical.  XML would be nice to have if we can do it though.
>>
>>
>> >
>> > On Wed, Jun 12, 2013 at 4:58 PM, Chris Geer <ch...@cxtsoftware.com>
>> wrote:
>> > > All, I've been working on the web services and something that I think
>> we
>> > > need to implement is being able to return reduced data sets. For
>> example,
>> > > if you get a list of people it should contain some less information for
>> > > each person than if you got a single person. There is a really easy way
>> > to
>> > > handle this in JSON using the @JSONView annotation from Jackson. It's a
>> > > little tricker with XML but do-able as well.
>> > >
>> > > I'm of the opinion that we could get away with only returning JSON but
>> > what
>> > > does everyone else think?
>> > >
>> > > Chris
>> >
>>

Re: XML vs JSON

Posted by Chris Geer <ch...@cxtsoftware.com>.
Sorry to bring this topic back up but I wanted to make sure the JSONView
approach will work with the Angular branch. Erin, when angular hits the web
service, does it expect the GET on the resource list to return the full
objects? Or can it get the full objects individually? The idea is that the
list would return a subset of the data (i.e. no need to return every detail
about every person when you just want a list of people).

Chris


On Thu, Jun 13, 2013 at 7:21 AM, Matt Franklin <m....@gmail.com>wrote:

> On Wed, Jun 12, 2013 at 5:31 PM, Erin Noe-Payne <erin.noe.payne@gmail.com
> >wrote:
>
> > I believe we are only interested in JSON.
> >
>
> JSON is critical.  XML would be nice to have if we can do it though.
>
>
> >
> > On Wed, Jun 12, 2013 at 4:58 PM, Chris Geer <ch...@cxtsoftware.com>
> wrote:
> > > All, I've been working on the web services and something that I think
> we
> > > need to implement is being able to return reduced data sets. For
> example,
> > > if you get a list of people it should contain some less information for
> > > each person than if you got a single person. There is a really easy way
> > to
> > > handle this in JSON using the @JSONView annotation from Jackson. It's a
> > > little tricker with XML but do-able as well.
> > >
> > > I'm of the opinion that we could get away with only returning JSON but
> > what
> > > does everyone else think?
> > >
> > > Chris
> >
>

Re: XML vs JSON

Posted by Matt Franklin <m....@gmail.com>.
On Wed, Jun 12, 2013 at 5:31 PM, Erin Noe-Payne <er...@gmail.com>wrote:

> I believe we are only interested in JSON.
>

JSON is critical.  XML would be nice to have if we can do it though.


>
> On Wed, Jun 12, 2013 at 4:58 PM, Chris Geer <ch...@cxtsoftware.com> wrote:
> > All, I've been working on the web services and something that I think we
> > need to implement is being able to return reduced data sets. For example,
> > if you get a list of people it should contain some less information for
> > each person than if you got a single person. There is a really easy way
> to
> > handle this in JSON using the @JSONView annotation from Jackson. It's a
> > little tricker with XML but do-able as well.
> >
> > I'm of the opinion that we could get away with only returning JSON but
> what
> > does everyone else think?
> >
> > Chris
>

Re: XML vs JSON

Posted by Erin Noe-Payne <er...@gmail.com>.
I believe we are only interested in JSON.

On Wed, Jun 12, 2013 at 4:58 PM, Chris Geer <ch...@cxtsoftware.com> wrote:
> All, I've been working on the web services and something that I think we
> need to implement is being able to return reduced data sets. For example,
> if you get a list of people it should contain some less information for
> each person than if you got a single person. There is a really easy way to
> handle this in JSON using the @JSONView annotation from Jackson. It's a
> little tricker with XML but do-able as well.
>
> I'm of the opinion that we could get away with only returning JSON but what
> does everyone else think?
>
> Chris