refactor: clean up OpenAPI schema for proper tags, summaries, and schemas#271
Open
markokraemer wants to merge 1 commit intorivet-dev:mainfrom
Open
refactor: clean up OpenAPI schema for proper tags, summaries, and schemas#271markokraemer wants to merge 1 commit intorivet-dev:mainfrom
markokraemer wants to merge 1 commit intorivet-dev:mainfrom
Conversation
…es, and schemas - Add 7 domain-specific tags (health, desktop, agents, filesystem, processes, config, acp) replacing the single flat 'v1' tag - Add summary + description doc comments to all 22 handlers that were missing them - Register 4 missing schemas (McpCommand, McpRemoteTransport, McpOAuthConfig, McpOAuthConfigOrDisabled) fixing broken $ref targets - Remove 14 orphan query-param schemas that utoipa inlines automatically - Declare correct content types for binary endpoints (image/png, video/mp4, application/octet-stream, text/event-stream, application/x-tar) - Fix upload request content types from text/plain to application/octet-stream and application/x-tar - Improve info section: title, description, contact, license URL, server description - Add parameter descriptions to all 14 previously undocumented query params - Expand build.rs rerun-if-changed to watch types.rs, desktop_types.rs, universal_events.rs, and error crate - Remove now-unnecessary type patches from patch-openapi-types.mjs
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Deep cleanup of the OpenAPI spec generation so the auto-generated output is clean, navigable, and structurally correct. All changes are in the Rust source annotations; the JSON output follows automatically via the existing utoipa pipeline.
https://github.com/markokraemer/sandbox-agent/releases/download/pr-assets-openapi/openapi-docs-video.mp4
What changed
Domain-specific tags (was: everything under a single
v1tag)All 71 operations are now grouped into 7 domain tags:
health,desktop,agents,filesystem,processes,config,acp. This makes the API reference navigable in Swagger UI, Mintlify, and SDK generators.Summaries and descriptions for every operation (was: 22 missing)
Added
/// summary+/// descriptiondoc comments to all handlers that lacked them (health, agents, filesystem, config, ACP). The generated spec now hassummaryanddescriptionon every single operation.Fixed 3 broken schema
$reftargets (CRITICAL)McpCommand,McpOAuthConfigOrDisabled, andMcpRemoteTransportwere referenced byMcpServerConfigbut never registered inApiDoc. Also addedMcpOAuthConfig. All$reftargets now resolve correctly, and the hackypatch-openapi-types.mjsworkarounds are no longer needed.Removed 14 orphan schemas
Query-param structs like
FsPathQuery,McpConfigQuery,ProcessListQueryetc. were registered incomponents/schemasbut utoipa inlines them as individual parameters. Removed the dead schema registrations.Correct content types for binary endpoints
image/pngvideo/mp4application/octet-streamtext/event-streamtext/plainapplication/octet-streamtext/plainapplication/x-tarImproved info section
sandbox-agent->Sandbox Agentsandboxagent.devBuild reliability
build.rsnow watchestypes.rs,desktop_types.rs,universal_events.rs, and the error crate (was only watchingrouter.rsandlib.rs)///descriptions to all 14 query parameters that lacked themFiles changed
server/packages/sandbox-agent/src/router.rs- Tags, doc comments, content types, ServerAddon modifierserver/packages/sandbox-agent/src/router/types.rs- Parameter descriptionserver/packages/sandbox-agent/src/desktop_types.rs- Parameter descriptionsserver/packages/openapi-gen/build.rs- Additional rerun-if-changed watchessdks/typescript/scripts/patch-openapi-types.mjs- Removed dead patchesdocs/openapi.json- Regenerated outputVerification
cargo checkpassescargo test -p sandbox-agent --lib- 22/22 passswagger-cli validate- valid OpenAPI 3.0.3openapi-typescriptgenerates correct types without patches