Proposal for 1.0: REST response always uses an array under entry field

0 views
Skip to first unread message

goosemanjack

unread,
Oct 16, 2009, 6:34:01 PM10/16/09
to OpenSocial - OpenSocial and Gadgets Specification Discussion
Current REST Response object specifies all data returned under "entry"
label. The "entry" field allows for singular Entry objects or arrays
of Entry objects.

Proposal is to always return an array of Entry objects, even when a
singular result is known. This will greatly simplify processing in
the container and SDKs

http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/REST-API.html#rfc.section.3.1

goosemanjack

unread,
Nov 6, 2009, 6:00:14 PM11/6/09
to OpenSocial - OpenSocial and Gadgets Specification Discussion
Patch created.
http://codereview.appspot.com/150053

Currently the 0.9 spec allows for entry to contain a single object in
certain cases. This updates the spec so that entry always uses an
array, even when endpoint is known to only return a single record.
--
clc
> http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/RES...

Lane LiaBraaten

unread,
Nov 10, 2009, 8:25:24 PM11/10/09
to opensocial-an...@googlegroups.com
I'm concerned about the ramifications of this change.  Using arrays everywhere in REST, means we need to use them in RPC, which surfaces in osapi code, resulting in:

osapi.people.getViewer().execute(function(result) {
  if (!result.error) {
    alert('Your name is ' + result.list.displayName + '!');
  }
});

I think there's another thread discussing entry vs list, but either way it seems to add an unnecessary level of nesting.

-Lane

--

You received this message because you are subscribed to the Google Groups "OpenSocial and Gadgets Specification Discussion" group.
To post to this group, send email to opensocial-an...@googlegroups.com.
To unsubscribe from this group, send email to opensocial-and-gadg...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.



Reply all
Reply to author
Forward
0 new messages