json rpc numeric id

62 views
Skip to first unread message

Eduard Szente

unread,
Jul 2, 2012, 10:25:36 AM7/2/12
to json...@googlegroups.com
Hi,

according to the examples in the jsonrpc spec (www.jsonrpc.org/specification#examples) the id of the response need to be the same type as the id from the request, i.e. there's a difference between:

--> {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": 1}
<-- {"jsonrpc": "2.0", "result": 19, "id": 1}

and

--> {"jsonrpc": "2.0", "method": "foobar", "id": "1"}
<-- {"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found."}, "id": "1"}

However in the jsonrpc4j implementation the id is always handled as a string and therefore both "id": "1" (string) and "id": 1 (numeric) get
a "id":"1" (string) in their response.

I appended a patch against rev. 238581 to fix this problem. Could you consider this for your next release?

Best Wishes

Eduard

jsonrpc4j.diff

Eduard Szente

unread,
Jul 31, 2012, 7:38:20 AM7/31/12
to json...@googlegroups.com
*bump* :)

Brian C. Dilley

unread,
Jul 31, 2012, 12:01:28 PM7/31/12
to json...@googlegroups.com
Sure, i've been lagging on this stuff - i'll attempt to cut a new release today with this and a number of other changes.
--
You received this message because you are subscribed to the Google Groups "jsonrpc4j" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jsonrpc4j/-/1e4iaN81CBIJ.
To post to this group, send email to json...@googlegroups.com.
To unsubscribe from this group, send email to jsonrpc4j+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jsonrpc4j?hl=en.

Brian

unread,
Jul 31, 2012, 2:01:20 PM7/31/12
to json...@googlegroups.com

Eduard Szente

unread,
Jul 31, 2012, 3:11:22 PM7/31/12
to json...@googlegroups.com
thanks
Reply all
Reply to author
Forward
0 new messages