Skip to content

Clean up API docstrings, remove "IPv6 unsupported"#9562

Merged
david-crespo merged 9 commits intomainfrom
jmcarp/docstring-newlines
Feb 13, 2026
Merged

Clean up API docstrings, remove "IPv6 unsupported"#9562
david-crespo merged 9 commits intomainfrom
jmcarp/docstring-newlines

Conversation

@jmcarp
Copy link
Contributor

@jmcarp jmcarp commented Dec 23, 2025

At the moment, some docstrings in the generated docs lack newlines, and string together multiple sentences without punctuation. For example, the provisioned field in the silo_utilization_list method is a bit garbled: https://docs.oxide.computer/api/silo_utilization_list.

Accounts for resources allocated by in silos like CPU or memory for running
instances and storage for disks and snapshots Note that CPU and memory
resources associated with a stopped instances are not counted here

This patch adds the missing newlines and punctuation to make this docstring readable. Note that these changes won't show up in the generated docs until we cut a new release.

Note: if this change makes sense, I'll also ask Claude to review all docstrings in this crate for similar issues.

cc @david-crespo in case this is relevant to your interests (docs style guide, making Claude do things).

/// Note that CPU and memory resources associated with a stopped instances are not counted here
/// Accounts for resources allocated by in silos like CPU or memory for running instances and storage for disks and snapshots.
///
/// Note that CPU and memory resources associated with a stopped instances are not counted here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a stopped instances

@david-crespo
Copy link
Contributor

Totally on board. You will have to regen the openapi schema with cargo xtask openapi generate. I believe these changes are considered non-semantic with respect to the schema but I don't have enough experience with the new versioning setup to know exactly what will happen here.

@jmcarp jmcarp force-pushed the jmcarp/docstring-newlines branch from 80f0aff to 151c22c Compare December 23, 2025 18:40
@jmcarp
Copy link
Contributor Author

jmcarp commented Dec 23, 2025

Ok, I had Claude make more edits, and checked in a markdown file to make these rules at least somewhat repeatable.

You will have to regen the openapi schema with cargo xtask openapi generate.

I might be misunderstanding, but I think this isn't enough. I couldn't get the xtask to update the generated docs until I added a new (fake) version in nexus/external-api/src/lib.rs. Is there a different workflow for making docs-only changes to the openapi spec?

@jmcarp jmcarp marked this pull request as ready for review December 23, 2025 18:44
@david-crespo
Copy link
Contributor

A reasonable expectation, but I think that's how it's supposed to work.

#9546
oxidecomputer/dropshot-api-manager#35

@sunshowers
Copy link
Contributor

The change in #9546 means that you'll be asked to add a new version for non-semantic changes.

jmcarp and others added 9 commits February 13, 2026 11:09
At the moment, some docstrings in the generated docs lack newlines, and string
together multiple sentences without punctuation. For example, the `provisioned`
field in the `silo_utilization_list` method is a bit garbled:
https://docs.oxide.computer/api/silo_utilization_list.

> Accounts for resources allocated by in silos like CPU or memory for running
> instances and storage for disks and snapshots Note that CPU and memory
> resources associated with a stopped instances are not counted here

This patch adds the missing newlines and punctuation to make this docstring
readable. Note that these changes won't show up in the generated docs until we
cut a new release.

Note: if this change makes sense, I'll also ask Claude to review all docstrings
in this crate for similar issues.
@david-crespo david-crespo force-pushed the jmcarp/docstring-newlines branch from 151c22c to 0f11a86 Compare February 13, 2026 17:41
@david-crespo
Copy link
Contributor

david-crespo commented Feb 13, 2026

I rebased this on main and made the following changes on top:

  • Moved the lint guide from prompts/openapi_lint.md into .claude/skills/api-docs-lint/SKILL.md, expanding it to also cover endpoint summary lines (no articles, no periods) with examples
  • Removed stale "IPv6 not yet supported" docstrings from ip_pool_create and ip_pool_range_add endpoints (with a new API version 2026021300)
  • Wrapped long doc comments to fit within reasonable line widths in params.rs and views.rs
  • Removed trailing periods from short field descriptions ("The associated internet gateway." → "The associated internet gateway")

Nice diff of just my changes without the schema regen: 7662e33...aad16f9

@david-crespo david-crespo changed the title Add missing newlines in api docstrings. Clean up API docstrings, remove "IPv6 unsupported" Feb 13, 2026
@david-crespo david-crespo enabled auto-merge (squash) February 13, 2026 19:02
@david-crespo david-crespo merged commit aa12b67 into main Feb 13, 2026
16 checks passed
@david-crespo david-crespo deleted the jmcarp/docstring-newlines branch February 13, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants