feat(jsonrpc): generate OpenRPC definitions

When running `cargo test` in the deltachat-jsonrpc folder,
a new file `openrpc/openrpc.json` will be created with an
[OpenRPC](https://spec.open-rpc.org/) definition.

It can be copy-pasted into the
[OpenRPC playground](https://playground.open-rpc.org/)
and used to generate clients in other languages.
This commit is contained in:
Franz Heinzmann (Frando)
2022-11-25 15:24:25 +01:00
committed by link2xt
parent b9b0d20e8d
commit 5b435d11c7
17 changed files with 88 additions and 38 deletions

View File

@@ -144,7 +144,11 @@ impl CommandApi {
}
}
#[rpc(all_positional, ts_outdir = "typescript/generated")]
#[rpc(
all_positional,
ts_outdir = "typescript/generated",
openrpc_outdir = "openrpc"
)]
impl CommandApi {
/// Test function.
async fn sleep(&self, delay: f64) {