[WIP] OpenAPI support in rippled #101
justinr1234
started this conversation in
Ideas (pre standard proposal)
Replies: 1 comment
-
awesome idea. having automated openapi documentation would be super helpful especially from automated testing perspective. Especially for new features. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, the XRP Ledger (rippled) offers an ad-hoc JSON-RPC API. It is implemented in C++ through a variety of headers and function calls. Most of the input / output, parameters, responses, codes - or generally anything - are not documented in code or in spec. The API is manually documented on xrpl.org. See the public API methods reference.
Changes to this interface are picked up manually via people watching pull requests and manually translating this into xrpl.org docs or dependent client libraries such as xrpl.js and xrpl-py. In these dependent places, work is duplicated, and it is error-prone to keep the types in sync as well as bring the libraries in line with the latest changes in
rippled
.I would like to propose the creation of an OpenAPI interface that lives within the
rippled
repo directly, so that enforcement can potentially be done at a code level (during CI/CD testing, compile time static checks, or runtime checking — or a combination of all 3). The existing implementations in the code are good as-is, and should not be overly modified, but instead potentially a new approach could be to automatically generate implementation stubs from the OpenAPI YAML file going forward. The stubs can then be wired up to the existing code, so that everything is backwards compatible.I propose translating the existing docs and source code into a hand-written OpenAPI file that has good reuse.
(Work In Progress) Proposed file -- Suggest using https://editor.swagger.io/ to view it
Beta Was this translation helpful? Give feedback.
All reactions