Extend sitemap to include API and Management API reference routes. - #1534
Extend sitemap to include API and Management API reference routes.#1534scottjstrand1 wants to merge 1 commit into
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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 thelib/directory, which triggers a HIGH risk classification per repository rules for.tsfiles in shared utility directories. - The existing
app/sitemap.tsis 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.tsmodule 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
getAllApiReferencePathsfunction returns the expected paths for bothapiandmapispecs, and that the generated sitemap URLs are valid and resolve correctly. - Check that the new filter (
.filter((path) => !path.includes("/__"))) insitemap.tscorrectly excludes only internal content source files and does not inadvertently filter out legitimate pages. - Confirm that making the sitemap function
asyncdoes not introduce issues with Next.js sitemap generation or build behavior. - Review the
apiReferencePathToUrlhelper 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]?.pagesaccess pattern).
Sent by Cursor Automation: Docs PR classifier
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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.
| basePath: string, | ||
| overviewPages: { slug: string }[], | ||
| ): string[] { | ||
| const paths = new Set<string>([basePath, `${basePath}/overview`]); |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 45e8cdd. Configure here.




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