Skip to content

Extend sitemap to include API and Management API reference routes. - #1534

Open
scottjstrand1 wants to merge 1 commit into
mainfrom
docs-grade-improvements
Open

Extend sitemap to include API and Management API reference routes.#1534
scottjstrand1 wants to merge 1 commit into
mainfrom
docs-grade-improvements

Conversation

@scottjstrand1

Copy link
Copy Markdown
Contributor

Generate sitemap entries from the same path data used for static API reference pages, and exclude internal __content source files from content-based entries.

Generate sitemap entries from the same path data used for static API reference pages, and exclude internal __content source files from content-based entries.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 10, 2026 6:18pm

Request Review

@cursor cursor Bot 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.

Risk HIGH: Extends sitemap generation to include API and Management API reference routes by adding a new utility module in lib/ and modifying the existing sitemap function.

Reasons

  • A new TypeScript file (lib/sitemapEntries.ts) is added to the lib/ directory, which triggers a HIGH risk classification per repository rules for .ts files in shared utility directories.
  • The existing app/sitemap.ts is modified to change the sitemap function signature from synchronous to async (async function sitemap(): Promise<MetadataRoute.Sitemap>), which is a behavioral change to a build-time artifact.
  • The new lib/sitemapEntries.ts module imports from multiple sidebar and OpenAPI spec modules (apiOverviewSidebar, mapiOverviewSidebar, openApiSpec), creating new cross-module dependencies.
  • The diff totals 110 additions and 11 deletions across 2 files, with a brand-new 92-line utility module that generates sitemap entries dynamically from API reference path data.
  • The author (scottjstrand1) is not in the repository's contributors list, though they have push access and have authored recent PRs (#1531, #1532, #1533).

Notes

  • Verify that the getAllApiReferencePaths function returns the expected paths for both api and mapi specs, and that the generated sitemap URLs are valid and resolve correctly.
  • Check that the new filter (.filter((path) => !path.includes("/__"))) in sitemap.ts correctly excludes only internal content source files and does not inadvertently filter out legitimate pages.
  • Confirm that making the sitemap function async does not introduce issues with Next.js sitemap generation or build behavior.
  • Review the apiReferencePathToUrl helper for edge cases around empty or nested slug arrays.
  • Validate that the imported sidebar content structures (API_REFERENCE_OVERVIEW_CONTENT, MAPI_REFERENCE_OVERVIEW_CONTENT) match the expected shape ([0]?.pages access pattern).
Open in Web View Automation 

Sent by Cursor Automation: Docs PR classifier

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 45e8cdd. Configure here.

Comment thread lib/sitemapEntries.ts
basePath: string,
overviewPages: { slug: string }[],
): string[] {
const paths = new Set<string>([basePath, `${basePath}/overview`]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sitemap includes redirecting base paths

Medium Severity

getOverviewPaths always adds the API and Management API base paths to the sitemap, but those routes redirect to their /overview counterparts in next.config.js. Search engines then hit redirecting URLs instead of the canonical overview pages this PR is trying to expose.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 45e8cdd. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant