REST API + Batch + Response 200 is returned also if you have a syntax error

20 views
Skip to first unread message

Christophe Willemsen

unread,
Aug 1, 2012, 9:30:29 AM8/1/12
to ne...@googlegroups.com
Hello,

Neo4j Server 1.8M06

Situation :

Given the following request taken from the doc (NB I changed intentionnally the last operation id to an already, so there is a duplicate in the request)

Example request

[ {
  "method" : "POST",
  "to" : "/node",
  "id" : 0,
  "body" : {
    "name" : "bob"
  }
}, {
  "method" : "POST",
  "to" : "/node",
  "id" : 1,
  "body" : {
    "age" : 12
  }
}, {
  "method" : "POST",
  "to" : "{0}/relationships",
  "id" : 3,
  "body" : {
    "to" : "{1}",
    "data" : {
      "since" : "2010"
    },
    "type" : "KNOWS"
  }
}, {
  "method" : "POST",
  "to" : "/index/relationship/my_rels",
  "id" : 3,
  "body" : {
    "key" : "since",
    "value" : "2010",
    "uri" : "{3}"
  }
} ]


If you execute this query, you do not receive an exception for a duplicated operation id.

The query does not pass and the database is not affected by the changes.

BUT ! You receive a 200 status code and full representations of the "not" created nodes. you just get a 404 for the
relation query.

I think it should rather return a 404 response code and do not return the nodes representations.

Here the full response :

,"outgoing_relationships":"http://192.168.43.29:7474/db/data/node/649321/relationships/out","traverse":"http://192.168.43.29:7474/db/data/node/649321/traverse/{returnType}","all_typed_relationships":"http://192.168.43.29:7474/db/data/node/649321/relationships/all/{-list|&|types}","property":"http://192.168.43.29:7474/db/data/node/649321/properties/{key}","all_relationships":"http://192.168.43.29:7474/db/data/node/649321/relationships/all","self":"http://192.168.43.29:7474/db/data/node/649321","properties":"http://192.168.43.29:7474/db/data/node/649321/properties","outgoing_typed_relationships":"http://192.168.43.29:7474/db/data/node/649321/relationships/out/{-list|&|types}","incoming_relationships":"http://192.168.43.29:7474/db/data/node/649321/relationships/in","incoming_typed_relationships":"http://192.168.43.29:7474/db/data/node/649321/relationships/in/{-list|&|types}","create_relationship":"http://192.168.43.29:7474/db/data/node/649321/relationships","data":{"_id":"50192ece61312","name":"some 50192ece61309 name"}},"location":"http://192.168.43.29:7474/db/data/node/649321","status":201},{"id":5,"from":"http://192.168.43.29:7474/db/data/relationship/12231/relationships","body":null,"status":404}

Regards,

Christophe

Peter Neubauer

unread,
Aug 1, 2012, 9:41:21 AM8/1/12
to ne...@googlegroups.com
That is totally true IMHO.

Could you raise a bug under https://github.com/neo4j/community/issues with this nice explaination attached?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Wanna learn something new? Come to @graphconnect.

Christophe Willemsen

unread,
Aug 1, 2012, 9:57:21 AM8/1/12
to ne...@googlegroups.com
Im in my car right but ill do it this evening

Christophe Willemsen

unread,
Aug 1, 2012, 12:19:01 PM8/1/12
to ne...@googlegroups.com

Peter Neubauer

unread,
Aug 1, 2012, 12:35:29 PM8/1/12
to ne...@googlegroups.com
Thanks, did add the labels.

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Wanna learn something new? Come to @graphconnect.


On Wed, Aug 1, 2012 at 6:19 PM, Christophe Willemsen
<willemsen....@gmail.com> wrote:
> Done ! https://github.com/neo4j/community/issues/753
Reply all
Reply to author
Forward
0 new messages