-
Notifications
You must be signed in to change notification settings - Fork 250
docs(relay): add API documentation for RelayClient and its methods #6970
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
base: main
Are you sure you want to change the base?
Conversation
Add detailed Rust doc comments to `RelayClient`, `RelayAddress`, and all public methods to clarify usage, parameters, authentication, and known server limitations for the Relay API client.
@groovecoder Thank you for adding these docs 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotta love better docs, thanks!
/// usage stats, and identifying information. | ||
/// | ||
/// See: | ||
/// https://dev.fxprivaterelay.nonprod.cloudops.mozgcp.net/api/v1/docs/redoc/#tag/emails/operation/relayaddresses_retrieve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this link to a .md file or similar in some git repo? This url smells fragile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I've opened mozilla/fx-private-relay#5903 to publish the API docs to the Relay repo's GitHub Pages site. When we get that url working I'll update this.
/// managing authorization to call protected endpoints. | ||
/// | ||
/// # Authorization | ||
/// - Clients should user the `FirefoxAccount.getAccessToken()` function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea if/how any of this works in terms of rustdocs etc 😅 - but maybe fxa_client::FirefoxAccount::getAccessToken()
? I doubt either of these will render a workable link though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's the path to use, but also with brackets: [fxa_client::FirefoxAccount::getAccessToken()]
. That should render a correctlink in rustdoc. It won't work for the generated Kotlin/Swift/JS docs, but it's something we could eventually get working.
Also: the parens are optional and backticks are allowed, but ignored.
https://doc.rust-lang.org/rustdoc/write-documentation/linking-to-items-by-name.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I thought about trying to figure it out, but then even if I got the rust docs to link together, I doubt it would carry thru to the Swift or Kotlin docs too, which is the main goal here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, other than the link issue. I don't need to re-review that though.
/// managing authorization to call protected endpoints. | ||
/// | ||
/// # Authorization | ||
/// - Clients should user the `FirefoxAccount.getAccessToken()` function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's the path to use, but also with brackets: [fxa_client::FirefoxAccount::getAccessToken()]
. That should render a correctlink in rustdoc. It won't work for the generated Kotlin/Swift/JS docs, but it's something we could eventually get working.
Also: the parens are optional and backticks are allowed, but ignored.
https://doc.rust-lang.org/rustdoc/write-documentation/linking-to-items-by-name.html
Add detailed Rust doc comments to
RelayClient
,RelayAddress
, and all public methods to clarify usage, parameters, authentication, and known server limitations for the Relay API client.Pull Request checklist
Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.