rippled icon indicating copy to clipboard operation
rippled copied to clipboard

Proposal: remove "status":"success" from API responses

Open mDuo13 opened this issue 6 years ago • 3 comments

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.

mDuo13 avatar Mar 28 '18 01:03 mDuo13

http://www.jsonrpc.org does not mandate a "status" field in the response either by the way.

MarkusTeufelberger avatar Mar 28 '18 10:03 MarkusTeufelberger

Consider this for API v2

carlhua avatar Sep 16 '20 19:09 carlhua

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?

intelliot avatar Feb 09 '24 06:02 intelliot