Skip to content

fix(docs): use absolute API doc links in developer docs#38649

Merged
hainenber merged 3 commits intoapache:masterfrom
Mayankaggarwal8055:fix/dev-doc-links-subpath-clean
Mar 14, 2026
Merged

fix(docs): use absolute API doc links in developer docs#38649
hainenber merged 3 commits intoapache:masterfrom
Mayankaggarwal8055:fix/dev-doc-links-subpath-clean

Conversation

@Mayankaggarwal8055
Copy link
Contributor

@Mayankaggarwal8055 Mayankaggarwal8055 commented Mar 14, 2026

User description

Fixes #38590

This updates the API links in docs/developer_docs/api.mdx from relative ./api/... paths to absolute /docs/api/... paths.

When the developer docs page is opened from a nested URL like /developer-docs/api/, the relative links resolve incorrectly and add an extra api path segment. Using absolute paths ensures the endpoint documentation links resolve correctly.

Changes

  • Updated markdown links in docs/developer_docs/api.mdx
  • Replaced broken relative ./api/... links with absolute /docs/api/... links
  • Kept the change limited to the affected docs file

Testing

  • Verified the change is limited to docs/developer_docs/api.mdx
  • Confirmed the updated links no longer depend on the current nested page path

CodeAnt-AI Description

Fix developer docs API links to use absolute /developer-docs/api/ paths

What Changed

  • Replaced relative "./api/..." links with absolute "/developer-docs/api/..." links in developer API reference so links resolve correctly from any developer-docs page
  • Prevents duplicated "api" path segments when opening developer docs from nested URLs
  • Navigation from developer docs now goes directly to the correct API reference pages (no path-dependent link resolution)

Impact

✅ No broken developer-doc links from nested pages
✅ Correct navigation to API reference pages
✅ Fewer 404s when following API links

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@github-actions github-actions bot added the doc Namespace | Anything related to documentation label Mar 14, 2026
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Mar 14, 2026

AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

@codeant-ai-for-open-source codeant-ai-for-open-source bot added the size:L This PR changes 100-499 lines, ignoring generated files label Mar 14, 2026
@dosubot dosubot bot added the doc:developer Developer documentation label Mar 14, 2026
@codeant-ai-for-open-source
Copy link
Contributor

Sequence Diagram

This PR updates endpoint links in the developer API documentation from relative paths to absolute docs paths. The new flow ensures clicking any endpoint link from nested developer docs routes always opens the correct API reference page.

sequenceDiagram
    participant Reader
    participant DeveloperDocsPage
    participant DocsRouter
    participant ApiReferencePage

    Reader->>DeveloperDocsPage: Open developer API docs from nested route
    Reader->>DeveloperDocsPage: Click an endpoint link
    DeveloperDocsPage->>DocsRouter: Resolve link as absolute docs api path
    DocsRouter->>ApiReferencePage: Navigate to endpoint documentation
    ApiReferencePage-->>Reader: Display correct API reference page
Loading

Generated by CodeAnt AI

@netlify
Copy link

netlify bot commented Mar 14, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 6350371
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69b5814a2578b30008ea080c
😎 Deploy Preview https://deploy-preview-38649--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Mayankaggarwal8055
Copy link
Contributor Author

@maintainers I’ve opened this docs fix for #38590. The change is limited to docs/developer_docs/api.mdx and updates the broken relative links to absolute paths. I’d appreciate a review when possible.

@hainenber
Copy link
Contributor

@Mayankaggarwal8055 thanks for opening a PR to address the linked issue! Unfortunately, /docs/api absolute URL is not a correct path, it should be /developer-docs/api instead. Can you do the replacement?

@hainenber hainenber self-requested a review March 14, 2026 14:30
@hainenber hainenber self-assigned this Mar 14, 2026
@hainenber
Copy link
Contributor

btw, you'll need to change the absolute path in the script used to generate the api.mdx as well, for future APIs.

diff --git a/docs/scripts/generate-api-index.mjs b/docs/scripts/generate-api-index.mjs
index e5f6a7e693..2fd9fddac6 100644
--- a/docs/scripts/generate-api-index.mjs
+++ b/docs/scripts/generate-api-index.mjs
@@ -202,7 +202,7 @@ curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
     mdx += `| Method | Endpoint | Description |\n`;
     mdx += `|--------|----------|-------------|\n`;
     for (const ep of tagEndpoints['Security']) {
-      mdx += `| \`${ep.method}\` | [${ep.summary}](./api/${ep.slug}) | \`${ep.path}\` |\n`;
+      mdx += `| \`${ep.method}\` | [${ep.summary}](/developer-docs/api/${ep.slug}) | \`${ep.path}\` |\n`;
     }
     mdx += '\n';
     renderedTags.add('Security');
@@ -229,7 +229,7 @@ curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
       mdx += `|--------|----------|-------------|\n`;
 
       for (const ep of endpoints) {
-        mdx += `| \`${ep.method}\` | [${ep.summary}](./api/${ep.slug}) | \`${ep.path}\` |\n`;
+        mdx += `| \`${ep.method}\` | [${ep.summary}](/developer-docs/api/${ep.slug}) | \`${ep.path}\` |\n`;
       }
 
       mdx += `\n</details>\n\n`;
@@ -252,7 +252,7 @@ curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
       mdx += `|--------|----------|-------------|\n`;
 
       for (const ep of endpoints) {
-        mdx += `| \`${ep.method}\` | [${ep.summary}](./api/${ep.slug}) | \`${ep.path}\` |\n`;
+        mdx += `| \`${ep.method}\` | [${ep.summary}](/developer-docs/api/${ep.slug}) | \`${ep.path}\` |\n`;
       }
 
       mdx += `\n</details>\n\n`;

@Mayankaggarwal8055
Copy link
Contributor Author

@hainenber Perfect catch! Fixing now:

✅ docs/developer_docs/api.mdx: /docs/api//developer-docs/api/
✅ docs/scripts/generate-api-index.mjs: Update auto-generation script

Pushing corrected paths in 3 minutes. Thanks! 🙏

- docs/developer_docs/api.mdx: /docs/api → /developer-docs/api (242 links)
- docs/scripts/generate-api-index.mjs: fix future API generation
- Addresses @hainenber review comments

Fixes apache#38590
@Mayankaggarwal8055
Copy link
Contributor Author

@hainenber Fixed! Pushed correct paths:

✅ docs/developer_docs/api.mdx: /docs/api//developer-docs/api/ (242 links)
✅ docs/scripts/generate-api-index.mjs: ./api//developer-docs/api/

Netlify preview will update shortly. Thanks! 🙏

@codeant-ai-for-open-source codeant-ai-for-open-source bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Mar 14, 2026
@hainenber
Copy link
Contributor

You are not pushing any changes to docs/scripts/generate-api-index.mjs as suggested, though?

@Mayankaggarwal8055
Copy link
Contributor Author

Mayankaggarwal8055 commented Mar 14, 2026

@hainenber
You were right — the script change had not been pushed. I've now updated and pushed docs/scripts/generate-api-index.mjs as well, so both the generated file and the generation script use /developer-docs/api/... paths. Thanks for catching that! 🙏

Copy link
Contributor

@hainenber hainenber left a comment

Choose a reason for hiding this comment

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

LGTM after verifying on Netlify preview app. Thank you.

@hainenber hainenber merged commit cc066b3 into apache:master Mar 14, 2026
64 checks passed
@bito-code-review
Copy link
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

michael-s-molina pushed a commit that referenced this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc:developer Developer documentation doc Namespace | Anything related to documentation size/L size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev docs: incorrect links when not entering the doc site usign root path

2 participants