AmbireTech / adex-validator-stack-rust

The Ambire AdEx Validator Stack implemented in Rust: sentry, validator worker, adapter, adview manager
https://adex.network
GNU Affero General Public License v3.0
11 stars 10 forks source link

Sentry REST API documentation #475

Closed elpiel closed 2 years ago

elpiel commented 2 years ago

We need a way to easily document the REST API of sentry in using rustdoc. Two ideas come to mind:

Doc macro for serialization (on hold)

We need to serialize to json & urlencode fir structs inside doc comments.

A similar macros to https://github.com/scrabsha/dep-doc with arguments of rust structs and expression: let my_struct = MyStruct { field: .. }

with the following variants:

Building docs

We now build docs based on aip-61-adex-v5 branch with default path to sentry crate and we deploy it with GH pages at:

https://ambiretech.github.io/adex-validator-stack-rust

elpiel commented 2 years ago

I've posted a question on the Rust user forum to see if it's even possible to capture the scope of the doc test and use variables inside it to generate JSON examples:

https://users.rust-lang.org/t/macro-invocation-in-rustdoc-and-generating-examples/74759

simzzz commented 2 years ago

Remaining tasks:

GET /v5/channel/:id/accounting
GET /v5/channel/:id/spender/:addr (auth required)
GET /v5/channel/:id/spender/all (auth required)
GET /v5/channel/:id/validator-messages @elpiel #534
POST /v5/channel/:id/validator-messages (auth required) @elpiel #534
GET /v5/channel/:id/last-approved @elpiel #534
POST /v5/channel/:id/pay (auth required)
GET /v5/channel/:id/get-leaf
POST /v5/channel/dummy-deposit (auth required) @elpiel #534
Other