docs(redirects): add /api-reference/latest/* → current dated version#46
Merged
Conversation
…-18/* Allows external consumers (dashboard CTAs, support links) to deep-link into the API reference with a stable, version-agnostic URL. On each dated version cut, update only the destination here — consumers stay put. Note: mint dev does not process the `redirects` block; verification happens on the Mintlify PR preview deployment. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
…le version Teaches the docs generator to write the /api-reference/latest/:slug* redirect into docs.json on every `pnpm generate` run, with the destination pulled from `stable[0]` of the live /versions endpoint. User-authored redirects are preserved by source-key. Only redirects whose source is in MANAGED_REDIRECT_SOURCES get re-derived. This removes the manual edit step at version-cut time: the next generate run after a stable version is promoted will pick up the new destination automatically. Verified by running `pnpm generate` against current /versions (stable=[2026-02-18]) — produces the same docs.json redirect block as the prior hand-edit (zero diff vs the previous commit on this branch). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Cali93
approved these changes
May 18, 2026
5 tasks
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
Adds a wildcard redirect from
/api-reference/latest/:slug*to the latest stable dated API version (2026-02-18today), and teachesscripts/generate-specs.mjsto derive that redirect from the live/versionsendpoint on every generate run.External consumers (merchant dashboard CTAs, support links, partner docs, ad-hoc bookmarks) can deep-link into the API reference using a stable, version-agnostic URL. On each future stable version cut, no docs.json hand-edit is needed — running
pnpm generatepicks up the new destination automatically.Why a generator-derived redirect, not a hardcoded one?
The 24 dated nav entries in
docs.jsonare already auto-generated from/versions. The redirect destination is the same kind of derived value, so it belongs in the generator alongside the nav. A hand-edit would have been a quiet drift risk: at the next version cut, the generator regenerates the nav, but the redirect would silently keep pointing at the old version unless someone remembered.Changes
docs.json— adds the redirect entry (also reproducible by runningpnpm generateagainst current/versions).scripts/generate-specs.mjs— addsbuildManagedRedirects(latestStableVersion),MANAGED_REDIRECT_SOURCES, andmergeRedirects(existing, latestStable). User-authored redirects (e.g./guides/**) are preserved by source-key; only redirects in the managed set get re-derived. Wired intomain()immediately afterbuildNavigation.Test plan
https://<preview-url>/api-reference/latest/post-v1-merchants301/302s tohttps://<preview-url>/api-reference/2026-02-18/post-v1-merchants(200).https://<preview-url>/api-reference/latest/get-v1-merchantsredirects similarly./guides/**→/custodians/**redirect still works (regression check).2026-02-18/*direct URLs still resolve.pnpm generateonmainafter merge produces zero diff against the mergeddocs.jsonredirect block (deterministic).Follow-up
Companion dashboard PR in
pay-merchant-experienceswaps the/merchantsempty-state "Read the Docs" CTA tohttps://docs.walletconnect.com/api-reference/latest/post-v1-merchants(tracked under WCPM-385). That PR is held until this one is merged + deployed.Notes
mint devdoes NOT process theredirectsblock locally. Verified existing/guides/**rule also 404s in dev. Verification only happens on the Mintlify hosted preview / production.pnpm generateagainst current/versions(stable=[2026-02-18]) produces a zero-diffdocs.jsonvs. the prior commit on this branch — proving the generator output matches the hand-edited redirect.pnpm generatefor unrelated reasons, it will also pick up upstream OpenAPI spec drift inapi/*.json. That drift was intentionally not included here (kept separate from the redirect prototype).🤖 Generated with Claude Code