docs: serve api-catalog by enabling download-spec - #890
Conversation
The docs site advertises </.well-known/api-catalog>; rel="api-catalog" in its Link header, but that path returns 404 because no OpenAPI download is configured. Adding "download-spec" to contextual.options makes Mintlify publish the RFC 9727 linkset at /.well-known/api-catalog, linking each OpenAPI spec declared in docs.json (including the OpenHands Cloud spec) so agents can discover the API. Co-authored-by: openhands <openhands@all-hands.dev>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
@OpenHands /codereview and post your feedback with event approved or request changes or comment as you think appropriate. |
|
Uh oh! There was an unexpected error starting the job :( |
enyst
left a comment
There was a problem hiding this comment.
Reviewed and verified against Mintlify docs plus the live production/preview sites.
What's correct ✅
- The change is minimal and does exactly what it says. Mintlify's docs confirm it: enabling
download-specpublishes the RFC 9727 linkset at/.well-known/api-catalog, and without it the path returns 404. - Production today:
https://docs.openhands.dev/.well-known/api-catalog→ 404 (matches the problem statement). - Preview (
allhandsai-docs-api-catalog-download-spec.mintlify.site):/.well-known/api-catalog→ 200, validapplication/linkset+json. - The security note is accurate:
docs.jsonhas noauth/userAuth, and every spec is served publicly (200), so the "unfiltered spec" caveat in the Mintlify docs doesn't apply here.
One discrepancy worth resolving ⚠️
The Summary says the catalog exposes "the OpenHands Cloud spec … and the Agent Server spec" (two specs). The preview catalog actually returns three:
| Title | Version | Source file |
|---|---|---|
OpenHands |
0.0.1 | openapi/openhands-cloud.json (Cloud REST API) |
OpenHands Agent Server |
0.1.0 | openapi/agent-sdk.json |
OpenHands |
0.53.0 | openapi/V0_openapi.json (legacy V0 REST API) |
V0_openapi.json is not referenced anywhere in docs.json — only agent-sdk.json and openhands-cloud.json carry "openapi": {"source": ...} navigation entries — and AGENTS.md explicitly marks it "legacy". So enabling download-spec also makes the deprecated V0 REST API (whose servers point at https://app.all-hands.dev) machine-discoverable to agents, and introduces a second spec titled "OpenHands" (v0.53.0) that is easy to confuse with the current Cloud spec (v0.0.1).
Not a blocker for the change itself — please just confirm exposing the legacy V0 spec is intended, or exclude/handle V0_openapi.json so the catalog advertises only the two current specs; and update the summary to mention the third spec if it stays.
The legacy V0_openapi.json is unreferenced in docs.json but Mintlify auto-uploads every OpenAPI spec in the repo, so enabling download-spec advertised it in the /.well-known/api-catalog linkset alongside the two current specs. Add a .mintignore entry to exclude it from publishing. Co-authored-by: openhands <openhands@all-hands.dev>
Summary
The docs site advertises a machine-readable API catalog in its
Linkheader:…but
https://docs.openhands.dev/.well-known/api-catalogcurrently returns 404, because no OpenAPI download is configured for the project.Mintlify publishes the RFC 9727 linkset at
/.well-known/api-catalogwhendownload-specis present incontextual.options. The catalog links each OpenAPI spec declared indocs.json— including the OpenHands Cloud spec (/openapi/openhands-cloud.json) — so agents can discover the Cloud API without crawling the docs.This change adds
"download-spec"tocontextual.optionsso the advertised catalog resolves and points at the Cloud API (and the Agent Server spec).Validation
docs.jsonparses as JSON.Note
Enabling
download-specalso adds a "Download API spec" entry to the page context menu, and (per Mintlify docs) the downloaded spec is unfiltered — i.e. it does not respect authentication groups. This site is public, so no group-restricted endpoints are exposed.This pull request was created by an AI agent (OpenHands) on behalf of the user.