feat: guard generated docs against /latest regressions (DOC-206)#1136
Merged
Conversation
@seamapi/types@1.879.0 (#1134) reintroduced docs.seam.co/latest into the generated API object pages after the 1.878.1 cleanup. Rather than depend on the upstream package staying clean, add a post-generate sanitization step (Phase G in mintlify-codegen/generate.ts) that strips `docs.seam.co/latest` -> `docs.seam.co` from openapi.json + api/**/*.mdx after every generate. The docs serve at root (no /latest); a /latest/:path* redirect handles old inbound URLs. Regenerated output is now /latest-free (guard stripped 26 files against 1.879.0). Verified: typecheck, validate:mintlify, and broken-links --check-anchors --check-redirects all pass. Closes DOC-206. Complements DOC-199 (upstream re-fix). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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.
Problem
@seamapi/types@1.879.0(#1134) reintroduceddocs.seam.co/latestinto the generated API object pages — regressing the cleanup that shipped in 1.878.1 (DOC-199). Relying on the upstream package staying/latest-free has now failed once.Fix
Add a post-generate sanitization step (Phase G in
mintlify-codegen/generate.ts) that stripsdocs.seam.co/latest→docs.seam.cofrom the generated output (openapi.json+api/**/*.mdx) after everygenerate/generate:mintlify. This keeps the docs/latest-free regardless of the@seamapi/typesversion. The docs serve at root; the existing/latest/:path*redirect handles old inbound URLs.This regen (run against the dirty 1.879.0) confirms the guard works: it stripped 26 files and the output has zero
docs.seam.co/latest.Verification
npm run typecheck✓npm run validate:mintlify✓mint broken-links --check-anchors --check-redirects→ no broken links ✓/latestinto a page, regenerated, guard reported "Sanitized 1" and the page came out clean.Closes DOC-206. Complements DOC-199 (upstream re-fix in
@seamapi/types).🤖 Generated with Claude Code