fix: resolve $ref in docs.json for OpenAPI routes coverage check#3572
Open
curquiza wants to merge 2 commits into
Open
fix: resolve $ref in docs.json for OpenAPI routes coverage check#3572curquiza wants to merge 2 commits into
curquiza wants to merge 2 commits into
Conversation
…vigation.json The navigation data (including OpenAPI routes) was moved from docs.json into config/navigation.json, referenced via a $ref. The script now resolves $ref pointers recursively before walking the tree. Fixes #3567 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/check-openapi-routes-coverage.mjs`:
- Around line 95-113: The resolveRefs function lacks cycle detection and will
infinite-recurse on circular $ref chains; add a visited/stack parameter (e.g.,
visitedPaths or refStack) to resolveRefs and push the resolved refPath (from
resolve(baseDir, obj["$ref"])) before recursing, check at the top whether
refPath is already in the stack and throw a clear error including the circular
chain if so, and ensure you pop the refPath after processing; update all
recursive calls (array, object entries, and the $ref branch) to pass along the
visited/stack so cycles like A->B->A are detected and fail fast.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 78888afa-a899-4759-8fee-f5f559e84228
📒 Files selected for processing (1)
scripts/check-openapi-routes-coverage.mjs
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
Require all OpenAPI routes in docs.jsonwas failing because navigation data (including OpenAPI routes) was moved fromdocs.jsonintoconfig/navigation.json, referenced via a$refpointercheck-openapi-routes-coverage.mjsnow resolves$refpointers recursively before walking the tree, so it works regardless of how the navigation is split across filesFixes #3567
Test plan
navigation.json🤖 Generated with Claude Code
Summary by CodeRabbit