XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.49k stars 1.45k forks source link

API v2 - API input and output should go through JSON schema validation #3512

Open carlhua opened 4 years ago

carlhua commented 4 years ago

Feature request.

The API should have a set of well-defined JSON Schemas that define which input and output values are validly formed. (Ripple Connect and RippleAPI do this already.) All API input should be verified against the schemas, and return an error if the request is not well-formed. Unit tests can use schemas to verify API output, as well.

It would also make documentation and testing much easier since there would be a single authoritative source to indicates which parameters each method can input and output. We could even use this to automate some aspects of API doc generation, as RippleAPI does.

This should be worked as part of API v2 vs bolting it onto existing APIs

Exported from RIPD-1101

MarkusTeufelberger commented 4 years ago

Maybe even OpenAPI/Swagger definitions?

mvadari commented 9 months ago

https://github.com/XRPLF/XRPL-Standards/discussions/101