You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Neither the "version" method nor the "get_addresses" method require any parameters. However, these two methods behave differently depending upon whether the the JSON-RPC request includes an (empty) parameters argument. I believe full-service should sanitize / regularize these two cases, or improve the error message returned, as the current behavior is inconsistent and confusing.
To Reproduce
Case: method requires empty parameters object in request.
curl -s http://localhost:9090/wallet/v2 --data '{"method": "get_addresses", "jsonrpc": "2.0", "id": 1 }' -X POST -H 'Content-type: application/json'
{"method":"get_addresses","error":{"code":-32600,"message":"InvalidRequest","data":{"server_error":"\"Could not get value Error(\\\"invalid type: null, expected struct variant JsonCommandRequest::get_addresses\\\", line: 0, column: 0)\"","details":"Could not get value Error(\"invalid type: null, expected struct variant JsonCommandRequest::get_addresses\", line: 0, column: 0)"}},"jsonrpc":"2.0","id":1}
Case: method requires no parameters object in request.
curl -s http://localhost:9090/wallet/v2 --data '{"method": "version", "params":{}, "jsonrpc": "2.0", "id": 1 }' -X POST -H 'Content-type: application/json'
{"method":"version","error":{"code":-32600,"message":"InvalidRequest","data":{"server_error":"\"Could not get value Error(\\\"invalid type: map, expected unit variant JsonCommandRequest::version\\\", line: 0, column: 0)\"","details":"Could not get value Error(\"invalid type: map, expected unit variant JsonCommandRequest::version\", line: 0, column: 0)"}},"jsonrpc":"2.0","id":1}⏎
Expected behavior
Should a required parameter not be included in a RPC request, an error message not requiring understanding Rust is returned to the user.
If parameters are optional, the params: {} object can be omitted from the JSON RPC request.
Different error codes should be returned for different scenarios presented here.
Environment (please complete the following information):
Vanilla Ubuntu, latest Full Service release.
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
Neither the "version" method nor the "get_addresses" method require any parameters. However, these two methods behave differently depending upon whether the the JSON-RPC request includes an (empty) parameters argument. I believe full-service should sanitize / regularize these two cases, or improve the error message returned, as the current behavior is inconsistent and confusing.
To Reproduce
Case: method requires empty parameters object in request.
Case: method requires no parameters object in request.
Expected behavior
Should a required parameter not be included in a RPC request, an error message not requiring understanding Rust is returned to the user.
If parameters are optional, the params: {} object can be omitted from the JSON RPC request.
Different error codes should be returned for different scenarios presented here.
Environment (please complete the following information):
Vanilla Ubuntu, latest Full Service release.
Additional context
The text was updated successfully, but these errors were encountered: