Re: ERRest with nested JSON

2013-09-09 Thread Charles Young
Answering my own question: No idea if this works generally, but it's adequate for my case. In my ERXRouteController subclass I strip the topmost wrapper node which is generated as a null wrapper. I'm almost positive I should be doing this more elegantly using ERXRestFormat.Delegate

ERRest with nested JSON

2013-08-30 Thread Charles Young
Hi All, I have an API that I'm trying to recreate using Webobjects. The service communicates using nested JSON. So Instead of using: curl -X POST -d { name:'Andrew Schrag' } http://localhost:62092/cgi-bin/WebObjects/RESTExample.woa/ra/Person.json It expects something like: curl -X POST -d

Re: ERRest with nested JSON

2013-08-30 Thread Jesse Tayler
are you already having specific problems? have you checked out the example ERRest project? it’s terse, but it’s basically all there... as long as your model is correct you should be able to provide to-one relationship data - if it’s getting cut off, check your update method’s ERXKeyFilter

Re: ERRest with nested JSON

2013-08-30 Thread Amedeo Mantica
Are u using extjs ? Amedeo Sent from my iPhone On 31/ago/2013, at 00:36, Charles Young char...@neuralglue.com wrote: Hi All, I have an API that I'm trying to recreate using Webobjects. The service communicates using nested JSON. So Instead of using: curl -X POST -d { name:'Andrew

Re: ERRest with nested JSON

2013-08-30 Thread Charles Young
Hi Jesse, Yes, I am having a specific problem. I'm using the ErRestRoutesExample app to do my testing - always easier to start with a known good working project. The call: curl -X POST -d { name:'Andrew Schrag' } http://localhost:62092/cgi-bin/WebObjects/RESTExample.woa/ra/Person.json

Re: ERRest with nested JSON

2013-08-30 Thread Charles Young
Hi Amedeo, No - or at least I don't believe so. I'm using the vanilla ERRestRouteExample project as a testbed. Cheers, Charles On Aug 30, 2013, at 4:45 PM, Amedeo Mantica amedeomant...@me.com wrote: Are u using extjs ? Amedeo Sent from my iPhone On 31/ago/2013, at 00:36, Charles

Re: ERRest with nested JSON

2013-08-30 Thread Paul Yu
Does the Property # No type in the JSON ERXRest.writeTypeKey=true work? Paul On Aug 30, 2013, at 11:05 PM, Charles Young char...@neuralglue.com wrote: Hi Amedeo, No - or at least I don't believe so. I'm using the vanilla ERRestRouteExample project as a testbed. Cheers, Charles

Re: ERRest with nested JSON

2013-08-30 Thread Charles Young
Hi Paul, The setting makes no difference that I can see. Please note though, the code behaves correctly for the route and filters as it is configured. My issue is that I am wrapping the payload in an unexpected way. It is expecting the person attributes directly, I am wrapping the attributes