refactor: add object page links to schema descriptions#1257
Draft
razor-x wants to merge 2 commits into
Draft
Conversation
Append a 'See [the `device` object](/api/devices/object).' sentence to every component schema that backs a generated object page, so Mintlify's inline-expanded endpoint responses point readers at the full resource reference. Scoped per-endpoint action_attempt schemas get the same link. Only resources actually rendered on an object page are linked: sampled resources at the page's own route, plus explicit resource_type pages (e.g. /action_attempts). Filtered views of a shared resource (/locks, /thermostats) don't claim the type. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y31Y4b3uGxyoeG7nVmum5S
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
This change automatically appends "See the
<type>object." sentences to OpenAPI schema descriptions for resources that have dedicated object pages. This improves discoverability by linking endpoint responses to their full resource reference documentation.Key Changes
ObjectPageMetadatatype to track which routes render object pages, enabling the codegen pipeline to map blueprint resources to their documentation pagesbuildObjectPageLinks()function that:transformComponents()to append object page links to all schemas that back object pages, ensuring the link appears after any truncationcreateScopedActionAttempt()to include object page links for inline action_attempt schemas in endpoint responsesobjectPagesmetadata to the transform functionImplementation Details
The solution uses a two-pass approach:
Links are appended after other description content and truncation to ensure they're never cut off in the rendered documentation. The implementation respects the existing resource routing logic where resources documented at their own route take precedence over filtered views.
https://claude.ai/code/session_01Y31Y4b3uGxyoeG7nVmum5S