Skip to content

feat(docs): publish the API description where machines look for it - #12595

Open
jd wants to merge 3 commits into
mainfrom
devs/jd/agentic-readiness/publish-api-desc-machines-look--1b625f96
Open

feat(docs): publish the API description where machines look for it#12595
jd wants to merge 3 commits into
mainfrom
devs/jd/agentic-readiness/publish-api-desc-machines-look--1b625f96

Conversation

@jd

@jd jd commented Aug 28, 2026

Copy link
Copy Markdown
Member

The Mergify OpenAPI 3.1 document is already deployed — it is what the API
Reference pages are generated from — but only at /api-schemas.json, a
filename that exists nowhere outside this repository. Every OpenAPI client,
SDK generator and crawler probes /openapi.json, so nothing finds it and the
docs read as a site with no API at all.

Serve the same bytes at /openapi.json. The route does not transform the
document: the spec is synced from the engine repository, and two spellings of
it that could disagree would be worse than one obscure path.

Alongside it, three other entry points that were undiscoverable:

  • <link rel="service-desc"> in every page head, the IANA relation for "the
    description of this site's API" (RFC 8631), plus one for llms.txt.
  • robots.txt had no Sitemap: line, so crawlers had to guess
    sitemap-index.xml rather than be told.
  • /developers is the path people and tools guess for a developer portal and
    was a 404; it now redirects to the API reference.

Depends-On: #12594

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 28, 2026 13:26 Failure
@jd

jd commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(seo): restore the homepage OpenGraph image #12593
2 fix(a11y): stop docset grids skipping a heading level #12594
3 feat(docs): publish the API description where machines look for it #12595 👈
4 feat(docs): serve Markdown to clients that ask for it #12596
5 feat(docs): tell agents what Mergify is for in llms.txt #12597
6 feat(seo): describe the site with schema.org JSON-LD #12598
7 feat(docs): point a lost agent somewhere useful from the 404 #12599

@mergify

mergify Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 2 of 7 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 👀 Review Requirements 👀 reviews
🔴 🔎 Reviews 👀 reviews
🟢 ⛓️ Depends-On Requirements
🟢 🤖 Continuous Integration
🟢 Enforce conventional commit
🟢 📕 PR description
🟢 🚦 Auto-queue

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.
  • any of:
    • #approved-reviews-by >= 2
    • author = dependabot[bot]
    • author = renovate[bot]
    • all of:
      • author = mergify-ci-bot
      • -head ~= ^docs-agent/

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

Show 5 satisfied protections

🟢 ⛓️ Depends-On Requirements

Requirement based on the presence of Depends-On in the body of the pull request

🟢 🤖 Continuous Integration

  • all of:
    • check-success = build
    • check-success = lint
    • check-success = test
    • any of:
      • check-success = test-broken-links
      • label = ignore-broken-links
    • any of:
      • check-success=Cloudflare Pages
      • -head-repo-full-name~=^Mergifyio/

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot requested a review from a team August 28, 2026 13:28
@jd
jd marked this pull request as ready for review August 28, 2026 14:07
Copilot AI lite review requested due to automatic review settings August 28, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves machine discoverability of the Mergify OpenAPI spec and related developer-entry signals by exposing conventional URLs and metadata that tooling and crawlers expect.

Changes:

  • Adds an /openapi.json endpoint that serves the existing public/api-schemas.json OpenAPI document.
  • Adds <link rel="service-desc"> (OpenAPI) and an alternate link for llms.txt to the global page head.
  • Updates robots.txt to include a Sitemap: directive and adds /developers redirects to the API reference.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/pages/openapi.json.ts New endpoint serving the OpenAPI document at the conventional discovery path.
src/components/HeadCommon.astro Adds machine-readable <link> entry points for OpenAPI discovery and llms.txt.
public/robots.txt Adds an explicit sitemap directive for crawlers.
public/_redirects Redirects /developers to the API reference.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/pages/openapi.json.ts Outdated
@jd
jd force-pushed the devs/jd/agentic-readiness/publish-api-desc-machines-look--1b625f96 branch from d8b4503 to c8af4a6 Compare August 28, 2026 14:37
@jd

jd commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial d8b4503 2026-08-28 14:37 UTC
2 content d8b4503 → c8af4a6 Serve the spec as a Buffer per review on #12595, so 'same bytes' is literal 2026-08-28 14:37 UTC
3 rebase c8af4a6 → eb8bd0c (rebase only) 2026-08-28 15:09 UTC

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 28, 2026 14:37 Failure
jd added 3 commits August 28, 2026 17:08
`getOgImageUrl` strips the leading and trailing slashes off the pathname to
build the image filename. For the homepage that pathname is `/`, so stripping
left an empty string and the lookup missed — every docs page had an OpenGraph
image and the homepage shipped `<meta property="og:image">` with no content.

The homepage's collection id is `index`, which is what `getStaticPaths` names
its image, so fall back to that when the slug comes out empty.

Covered by a regression test that fails against the old expression. The
generated-image set comes from the content collection and needs the Astro build
pipeline, so the test stubs it and exercises the derivation, which is the half
that was wrong.

Change-Id: Ifb9a23ea2caa20d28489a4f21363d85ed5e3342c
Docset cards rendered their title as `h4`. Almost every grid sits directly
under an `##`, so the outline jumped h2 to h4 — including on the homepage,
whose whole body is the "Products" grid. Screen readers and anything parsing
the document outline read that as a missing level.

Default the card heading to `h3` and make it a prop, because one grid does
belong at h4: the "Components" grid in `ci-insights.mdx` is nested under an
`### Components`, where h3 would make the cards siblings of their own section
heading instead of children.

Change-Id: Ie01f4c2b03f1f2b7f798ae89b056135a5b00800e
The Mergify OpenAPI 3.1 document is already deployed — it is what the API
Reference pages are generated from — but only at `/api-schemas.json`, a
filename that exists nowhere outside this repository. Every OpenAPI client,
SDK generator and crawler probes `/openapi.json`, so nothing finds it and the
docs read as a site with no API at all.

Serve the same bytes at `/openapi.json`. The route does not transform the
document: the spec is synced from the engine repository, and two spellings of
it that could disagree would be worse than one obscure path.

Alongside it, three other entry points that were undiscoverable:

- `<link rel="service-desc">` in every page head, the IANA relation for "the
  description of this site's API" (RFC 8631), plus one for `llms.txt`.
- `robots.txt` had no `Sitemap:` line, so crawlers had to guess
  `sitemap-index.xml` rather than be told.
- `/developers` is the path people and tools guess for a developer portal and
  was a 404; it now redirects to the API reference.

Change-Id: I1b625f960363c8427d5282c052fee74111bf07fa
@jd
jd force-pushed the devs/jd/agentic-readiness/publish-api-desc-machines-look--1b625f96 branch from c8af4a6 to eb8bd0c Compare August 28, 2026 15:09
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 28, 2026 15:09 Failure
Base automatically changed from devs/jd/agentic-readiness/stop-docset-grids-skipping-heading-level--e01f4c2b to main September 3, 2026 07:47
@mergify
mergify Bot requested a review from a team September 3, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants