jsonrpc4j
jsonrpc4j copied to clipboard
need RequestIDGenerator return Integer or Long
Currently we can use RequestIDGenerator override id generator logic. It's String generateID();
JSON-RPC 2.0 Specification identity the id can be a String, Number, or NULL.
id
An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]
The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.
Sometimes we need a id as Number. Using a id as String send request will get an error. -32700 Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
The reason for this problem is that the server-side implementation is not rigorous. Hope that jsonrpc4j is compatible with different id type requirements.