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

Correctly creates a Person entity, populates it and inserts it into the 
database.

The call:
curl -X POST -d "{'Person':{ name:'Andrew Schrag' }}" 
http://localhost:62092/cgi-bin/WebObjects/RESTExample.woa/ra/Person.json

(that is, I've wrapped an identical chunk of JSON as a Person attribute) 
creates an empty Person and returns a validation error (as the Person is not 
being updated with the correct attribute data).

My issue is that I want to populate a Person with a JSON payload that is 
wrapped in {Person: {[stuff that ERRest is expecting]}}

Hope that clarifies things, and thanks for your response.

Charles Young
NEURAL GLUE

503.360.3178
[email protected]
neuralglue.com

On Aug 30, 2013, at 3:47 PM, Jesse Tayler <[email protected]> wrote:

> 
> 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 because you’d need it there.
> 
> I suppose that additionally, these objects need to exist already and you’d 
> have the related id's along with any changed attributes listed in the filter 
> for these relationships.
> 
> anyway, maybe that helps some.
> 
> 
> On Aug 30, 2013, at 6:36 PM, Charles Young <[email protected]> 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 Schrag' }" 
>> http://localhost:62092/cgi-bin/WebObjects/RESTExample.woa/ra/Person.json
>> 
>> It expects something like:
>> curl -X POST -d "{'Person':{ name:'Andrew Schrag' }}" 
>> http://localhost:62092/cgi-bin/WebObjects/RESTExample.woa/ra/Person.json
>> 
>> Is there some simple way of creating an ERXRoute or an ERXKeyFIlter that 
>> will describe the nesting, or should I be looking at providing my own 
>> updateObjectWithFilter method that will assume a nested level.
>> 
>> Thanks for any hints.
>> 
>> 
>> Cheers,
>> Charles
>> 
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com
>> 
>> This email sent to [email protected]
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to