This looks like a JSON conversion bug in the IdSpec object or in the jsonrpccontainer. Ill take a look....
On Wed, Oct 8, 2008 at 10:09 AM, Chris Chabot <[EMAIL PROTECTED]> wrote: > Hey Bob, Louis & shindig-dev, > > While testing the new social api i've commited today i've run into the > strangest thing... depending on if a gadget uses the opensocial-0.7 or 0.8 > feature, the idSpec that it recieves is completely different in it's format > ... And i can't seem to make sense out of it. > > See when I do this in a Require feature="opensocial-0.7" gadget: > var req = opensocial.newDataRequest(); > req.add(req.newFetchPeopleRequest(opensocial.DataRequest.Group.VIEWER_FRIENDS), > 'viewerFriends'); > .. etc.. > > firebug shows that the request on the wire is (as i would expect it to be): > {"method":"people.get","params":{ > *"userId":["@viewer"], "groupId":"@friends", > * > "fields":["id","name","thumbnailUrl","id","displayName"],"count":20,"sortBy":"topFriends","filterBy":"all"},"id":"viewerFriends"} > > However when I fire up a opensocial-0.8 using gadget that does: > var req = opensocial.newDataRequest(); > var spec = opensocial.newIdSpec({"userId" : "VIEWER", "groupId" : > "FRIENDS"}); > var params = { "max" : 10}; > req.add(req.newFetchPeopleRequest(spec, params), "req_friends"); > > firebug (and the crashing and burning php code) tells me the request is > now: > > {"method":"people.get","params":{ > * > "userId":[{"fields_":{"userId":"VIEWER","groupId":"FRIENDS"}}],"groupId":"@self", > * > "fields":["id","name","thumbnailUrl","id","displayName"],"count":1000,"sortBy":"topFriends","filterBy":"all"},"id":"req_friends"} > > Now maybe i miss-read the json-rpc spec document, but that data format > doesn't look familiar to me ... an object with a fields_ property and in it > the userId and groupId? that can't be right, right? > > I'd like have this confirmed before i start butchering my code to > compensate for this oddity :) > > -- Chris > >