Skip to content

Sentry REST API documentation #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
elpiel opened this issue Feb 25, 2022 · 2 comments · Fixed by #515, #516, #473, #524 or #534
Closed

Sentry REST API documentation #475

elpiel opened this issue Feb 25, 2022 · 2 comments · Fixed by #515, #516, #473, #524 or #534

Comments

@elpiel
Copy link
Member

elpiel commented Feb 25, 2022

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

  • Doc macro for serialization inside the doc comments - It's more difficult than expected, this is put on hold
  • Building json/queries example files using Rust and include them inside the docs

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:

  • doc_urlencode! - urlencode the struct and print it in docs
  • doc_json! - pretty-print the struct in json format inside the docs

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 elpiel changed the title Doc macro for Serialization of rust structs inside docs Doc macros for serialization to json & urlencode of structs inside doc comments Feb 25, 2022
@elpiel elpiel changed the title Doc macros for serialization to json & urlencode of structs inside doc comments Doc macros for serialization Feb 25, 2022
@elpiel elpiel changed the title Doc macros for serialization [On hold] Doc macros for serialization Apr 26, 2022
@elpiel
Copy link
Member Author

elpiel commented Apr 26, 2022

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

@elpiel elpiel changed the title [On hold] Doc macros for serialization [On hold] Sentry REST API documentation Jun 16, 2022
@elpiel elpiel changed the title [On hold] Sentry REST API documentation Sentry REST API documentation Jun 16, 2022
@elpiel elpiel linked a pull request Jun 23, 2022 that will close this issue
@elpiel elpiel pinned this issue Jun 29, 2022
@elpiel elpiel linked a pull request Aug 8, 2022 that will close this issue
@simzzz
Copy link
Contributor

simzzz commented Aug 8, 2022

Remaining tasks:

GET /v5/channel/:id/accounting
  • More thorough documentation
  • Examples for AccountingResponse::<CheckedState>
GET /v5/channel/:id/spender/:addr (auth required)
  • More thorough documentation
  • Examples for SpenderResponse
GET /v5/channel/:id/spender/all (auth required)
  • More thorough documentation
  • Examples for AllSpendersResponse
GET /v5/channel/:id/validator-messages @elpiel #534
  • Examples for ValidatorMessagesListQuery
  • Examples for ValidatorMessagesListResponse
POST /v5/channel/:id/validator-messages (auth required) @elpiel #534
  • More thorough documentation
  • Examples for ValidatorMessagesCreateRequest
GET /v5/channel/:id/last-approved @elpiel #534
  • More thorough documentation
  • Examples for LastApprovedQuery
  • Examples for LastApprovedResponse
POST /v5/channel/:id/pay (auth required)
  • Examples for ChannelPayRequest
GET /v5/channel/:id/get-leaf
  • Response examples
POST /v5/channel/dummy-deposit (auth required) @elpiel #534
  • Examples for ChannelDummyDeposit
Other

This was linked to pull requests Aug 9, 2022
@elpiel elpiel linked a pull request Aug 30, 2022 that will close this issue
@elpiel elpiel unpinned this issue Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment