Skip to content

fix(docs): link documented data types from the API reference - #12334

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/kozlek/devs/kozlek/api-data-type-links/link-documented-data-types-api-ref--23de38ed
Aug 6, 2026
Merged

fix(docs): link documented data types from the API reference#12334
mergify[bot] merged 1 commit into
mainfrom
devs/kozlek/devs/kozlek/api-data-type-links/link-documented-data-types-api-ref--23de38ed

Conversation

@kozlek

@kozlek kozlek commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The engine flags a schema node as a documented data type, and on the
configuration side ConfigOptions turns that flag into a link to the
matching section of the data-types page. The API reference publishes the
same flag and did nothing with it: BatchStatus.code rendered its twelve
values with no explanation and no pointer to the section that explains
them — the state documenting it was meant to fix, on the page a reader
most likely arrives from.

That left the convention enforcing something nobody consumed. The build
fails when a marked title has no matching heading, so the anchor was
being maintained for a link the API side never rendered.

Render "see " beside the values. The values stay: an API
consumer needs to know what a field accepts, and the marker only says
their meaning is written up elsewhere.

The type label is deliberately left alone. Substituting a title for the
accepted values there is exactly the regression that hoisting shared
enums into components caused for fifteen query parameters, and a marked
type used as a parameter would reintroduce it.

The flag is read from the referring node as well as the $ref target,
because pydantic publishes it inline for an inlined type and as a $ref
sibling for a hoisted one.

Part of MRGFY-8330

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

The engine flags a schema node as a documented data type, and on the
configuration side `ConfigOptions` turns that flag into a link to the
matching section of the data-types page. The API reference publishes the
same flag and did nothing with it: `BatchStatus.code` rendered its twelve
values with no explanation and no pointer to the section that explains
them — the state documenting it was meant to fix, on the page a reader
most likely arrives from.

That left the convention enforcing something nobody consumed. The build
fails when a marked title has no matching heading, so the anchor was
being maintained for a link the API side never rendered.

Render "see <data type>" beside the values. The values stay: an API
consumer needs to know what a field accepts, and the marker only says
their meaning is written up elsewhere.

The type label is deliberately left alone. Substituting a title for the
accepted values there is exactly the regression that hoisting shared
enums into components caused for fifteen query parameters, and a marked
type used as a parameter would reintroduce it.

The flag is read from the referring node as well as the `$ref` target,
because pydantic publishes it inline for an inlined type and as a `$ref`
sibling for a hoisted one.

Part of MRGFY-8330

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Change-Id: I23de38ed505614420d6ca72d376424621b1c9c7a
Copilot AI lite review requested due to automatic review settings August 6, 2026 14:14
@mergify
mergify Bot deployed to Mergify Merge Protections August 6, 2026 14:14 Active
@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 6 merge protections satisfied — ready to merge.

Show 6 satisfied protections

🟢 🤖 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/

🟢 👀 Review Requirements

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

🟢 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)(?:\(.+\))?!?:

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 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 6, 2026 14:17

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 updates the API reference renderer to consume the existing “documented data type” marker in the OpenAPI schema by adding a small “see <data type>” link next to enum value lists, pointing to the corresponding section on /configuration/data-types.

Changes:

  • Add a dataTypeLinkHtml() helper to conditionally render a “see …” link for enum properties flagged as documented data types (including when the flag is on the $ref sibling).
  • Extend schema enum rendering to append this link while keeping enum values visible.
  • Add Vitest coverage to ensure flagged enums link correctly and unflagged enums remain unchanged (including a regression test against the real published API schema).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/components/ApiReference/openapi.ts Adds conditional “see data type” link rendering for flagged enum properties in the API schema HTML output.
src/components/ApiReference/openapi.test.ts Adds tests validating link rendering behavior for flagged/unflagged enums and $ref-sibling markers, plus a real-schema regression check.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kozlek
kozlek marked this pull request as ready for review August 6, 2026 14:34
@mergify
mergify Bot requested a review from a team August 6, 2026 14:40
@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 2 minutes 54 seconds in the queue, including 2 minutes 29 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Aug 6, 2026
@mergify
mergify Bot merged commit a5a5acf into main Aug 6, 2026
11 checks passed
@mergify
mergify Bot deleted the devs/kozlek/devs/kozlek/api-data-type-links/link-documented-data-types-api-ref--23de38ed branch August 6, 2026 15:06
@mergify mergify Bot removed the queued label Aug 6, 2026
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.

4 participants