neo4j/community — Issue #110: Invalid Json with table...cap combination
Author: Romiko
Created: 2011-11-28 02:02:35+00:00
State: open

Hi,
When I try run this query via rest.
{"script":"g.v(0).out('HOSTS').filter{ it.Key == 'romikoagency'}.in('USER_BELONGS_TO').as('username').as('userGivenName').out('USER_LINKED_TO_PROGRAM').as('program').table(new Table()){it.Username}{it.GivenName}{it.Name}.cap"
}

Notice the combination of table and cap. I get this result in the raw HTTP response.
[ "[[userGivenName:romiko.derbynew, username:Romiko, program:Testa], [userGivenName:romiko.derbynew, username:Romiko, program:Zumba Lessons], [userGivenName:romiko.derbynew, username:Romiko, program:Counselling], [userGivenName:romiko.derbynew, username:Romiko, program:Counselling], [userGivenName:romiko.derbynew, username:Romiko, program:After Care]]" ]

The above JSON result is invalid, it should be
[
{"userGivenName":"romiko.derbynew", "username":"Romiko", "program":"Testa"},
{"userGivenName":"romiko.derbynew", "username":"Romiko", "program":"Zumba Lessons"}, {"userGivenName":"romiko.derbynew", "username":"Romiko", "program":"Counselling"},
{"userGivenName":"romiko.derbynew", "username":"Romiko", "program":"Counselling"},
{"userGivenName":"romiko.derbynew", "username":"Romiko", "program":"After Care"}
]

We have extended the Neo4jClient to now support table projections and cap combo, however, the JSON deserialization is broken due to the invalid json results.

Much Appreciated.