I'm implementing a json-rpc server, responding to json-rpc versions 1.0 or 2.0
I have a question about the "jsonrpc" element of the response:
The full request received is first parsed as json, and then analysed as a json-rpc request. If the parsing phase fails (invalid syntax for example), the server don't have any workable request.
The server than has to respond with a parser error response.
But how could the server know the "jsonrpc" value to send in the response ? It could be nothing (not a json-rpc 2.0 request) or a valid "jsonrpc" "2.0" response ?
Examples in the json-rpc 2.0 specifications ( rpc call with an empty Array, rpc call Batch invalid JSON, ... ) seems to "force" a json-rpc 2.0 response. Why ?
Thank you for your reply
VDG