mirage / irmin

Irmin is a distributed database that follows the same design principles as Git
https://irmin.org
ISC License
1.85k stars 157 forks source link

REST API: JSON parse error when numbers are not in quotes #287

Closed MagnusS closed 7 years ago

MagnusS commented 9 years ago

Submitting a task with date or uid represented as numbers without qoutes will result in a parse error on the server side.

POST example from update

{"task":{"date":1441131372,"uid":0,"owner":"api-tester","messages":["update key"]},"params":"Hello world"}

Returns "result: null" and this error on the server:

ERROR: server error Failure("process: not a valid JSON body \"{\\\"task\\\":{\\\"date\\\":1441131372,\\\"uid\\\":0,\\\"owner\\\":\\\"api-tester\\\",\\\"messages\\\":[\\\"update key\\\"]},\\\"params\\\":\\\"Hello world\\\"}\" [Ezjsonm.Parse_error(_, \"Ezjsonm.get_string\")]")
samoht commented 7 years ago

In 1.0, the high-level REST API has been removed. Only the low-level API to export and access the AO and RW stores is now available and these have been rewritten using webmachine so they are much more robust / consistent.