Le 2011-05-20 à 08:25, Mike Schrag a écrit :
>> Now, the problem is that the "commits" array is always empty in the
>> response, even if I pass an array with two commits in them. I found out that
>> the problem is because a commit have a "id" attribute, so ERRest try to find
>> an object with this id. So I removed "id" from the request just to see how
>> far it will go, and I'm getting those:
> you can set a new ERXRestFormatDelegate on the json format to redefine what
> the "id" key is ... we should probably convert that over to be a property
> lookup in the ERXRestFormatDelegate constructor.
>
>> What do I need to do in my class so that the descriptor returns a
>> IndexedPropertyDescriptor instead of PropertyDescriptor? Both GHPayload and
>> GHCommit have getters starting with "get" (I thought the problem was there,
>> before I didn't have any "get" in from the getters name).
> indexed properties aren't supported in the public wonder version .... try on
> my repo and see if it behaves differently?
On trunk, I'm getting this:
mai 20 10:32:17 RestTests[5566] ERROR er.rest.routes.ERXRouteController -
Request failed: /cgi-bin/WebObjects/RestTests.woa/-5566/ra/ghPayloads.json
NullPointerException
at java.util.HashSet.<init>(HashSet.java:99)
at
er.rest.ERXRestRequestNode.updateObjectWithFilter(ERXRestRequestNode.java:998)
at
er.rest.ERXRestRequestNode.createObjectWithFilter(ERXRestRequestNode.java:703)
at er.rest.routes.ERXRouteController.create(ERXRouteController.java:610)
at
com.wowodc.rest.controllers.GHPayloadController.createAction(GHPayloadController.java:44)
... skipped 4 stack elements
Coming from:
List<Object> existingValues = (List<Object>)
NSKeyValueCoding.DefaultImplementation.valueForKey(obj, keyName);
Set<Object> removedValues = new HashSet<Object>(existingValues);
existingValues is null when it pass over "commits". A "1:N" relation works
fine. If I set "commits" to be a single GHCommit object instead of an array, it
works. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]