oxidecomputer / oxidecomputer/dropshot

Want mechanism for distinguishing "Rust doc" from "API doc"

Open
#401 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
104
Avg merge
1d 19h
Merged PRs (30d)
22

Description

At the moment, I believe the two are intermingled: If one wants to document a Rust type with rustdoc, that documentation is implicitly exported as part of the openapi spec. Similarly, if one wants to add openapi documentation, that must be done via Rust comments.

Although it may be a reasonable default for these two documentation targets to have the same source, it's reasonable to want:

  • API docs not part of the Rust comments (i.e., they are applicable to the generated type), or
  • Rust docs not part of the Open API spec (i.e., they reference other Rust types, or Rust-specific features)

Here's an example: https://github.com/oxidecomputer/omicron/pull/1348/files/b427eded0dfdc10b7c9461a38f110e9c620d0f5f#r918269331

It would be nice to have a mechanism to annotate structs and enums passed through dropshot with "OpenAPI" vs "Rustdoc" specific usage, and filter these before generating the open API spec.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the issue and the referenced pull request discussion, then trace how Dropshot combines Rust comments with generated OpenAPI documentation. Define the annotation behavior for structs and enums, including how Rust-only and OpenAPI-only text is identified. Done means users can keep the two documentation targets separate when generating the OpenAPI specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, rust
Domain
api, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.