rippled
rippled copied to clipboard
Proposal: remove "status":"success" from API responses
This may be controversial since it's a breaking change, but...
The "status":"success"
field from the response is a source of constant confusion, especially on the submit command and related methods. I think it would make things simpler to remove it from all successful responses. The corresponding "status": "error"
can stay on error messages.
Applications already have to check for a wide range of errors including transport-layer errors like 400 Bad Request in the JSON-RPC API, not to mention the possible absence of many fields in successful responses. The required behavior after this change—look for a "status" field with the value "error" to detect errors—is not much different than the existing case from a machine perspective.
From the perspective of a human reading API responses, though, it's much better. Sadly, in 2018, we're still at the level of humans reading API responses from rippled, but maybe an easier-to-read API will help lead to an ecosystem where that's no longer necessary.
http://www.jsonrpc.org does not mandate a "status" field in the response either by the way.
Consider this for API v2
Why (or how) would an easier-to-read API help lead to an ecosystem where humans reading API responses from rippled is no longer necessary?