API reference: auto-generate from OpenAPI specs, add v1 and v2#2703
Merged
gaprl merged 1 commit intoJul 14, 2026
Merged
Conversation
c4abcf3 to
f79ae79
Compare
f79ae79 to
4e39355
Compare
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
4e39355 to
6eea4bd
Compare
6eea4bd to
2757431
Compare
2757431 to
107e02a
Compare
107e02a to
86de613
Compare
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.
Context
Since the Mintlify migration (#2634), the API reference has been a frozen snapshot: the checked-in
public_v1.openapi.yamlwas never refreshed, and every endpoint needed a hand-generated MDX stub plus adocs.jsonnav entry. Endpoints added to the API since May 28 (e.g. ticket link/unlink) never appeared in the docs. Support flagged this.Before the migration this was self-updating: the docs site linked out to
semgrep.dev/api/v1/docs, which ReDoc renders live from the backend's own spec.Refs APPEX-1187.
What
docs.jsonnow points at the specs via Mintlify'sopenapinavigation field. All per-endpoint MDX stubs and per-service overview pages are deleted; Mintlify generates a page per operation, grouped by OpenAPI tag. New endpoints in the spec show up in the docs with no manual work.public_v2.openapi.yaml(fromsemgrep.dev/api/v2/openapi.yaml, 214 operations) renders at/api-reference/v2/...(v1 and v2 share tag names, so v2 generates into its own directory). The API tab uses Mintlifydropdownsas a v1 / v2 (Experimental) version switcher at the top of the sidebar — one version's services shown at a time, which keeps the sidebar short (v2 alone has ~40 services). Global anchors (Registry/Playground/Academy) are untouched. v2 gets its own Overview pages (Introduction with maturity-level badges, Authentication, Terms of Use), derived from the v2 spec'sinfo.description.POST /deployments/{deploymentId}/tickets/linkand/tickets/unlinkendpoints.URL compatibility
/api-reference/v1/...and/api-reference/v2/..../api-reference/<service>/<endpoint>, plus Introduction/Authentication/Terms-of-Use) 307-redirect to their/v1/-prefixed equivalents via per-service:slug*wildcard redirects. Endpoint slugs themselves are unchanged (auto-generated slugs match the old scraped ones — verified by probing a localmintlify devbuild)..../list-code-or-supply-chain-findingsURL to.../list-code-supply-chain-or-ai-powered-scan-findings. Internal links were updated everywhere./api-reference/TicketingServiceetc.) got redirects to a representative endpoint in their group.Upstream spec bugs found (fix to follow in semgrep-app)
Mintlify validates specs strictly (ReDoc doesn't) and caught real bugs in the live specs, patched here in the checked-in copies:
type: boolinstead ofboolean(2×,is_malicious)tagsentries (AutomationsService,ProjectsService)type: Array of strings <int64>prose in theTeamCreate.repositoryIdstype fieldThese need fixing at the source, or the scheduled refresh (stacked PR #2706) will re-import them and its validate step will block the update. A follow-up semgrep-app PR will fix these and point
/api/v1/docs+/api/v2/docsat these Mintlify pages.Verification
npx mintlify validate(fromdocs/): build validation passednpx mintlify broken-links --check-redirects(what Docs CI runs): no broken links foundmintlify devserver: old v1 slugs return 200 (incl. the[beta]-...bracket URL), v2 pages render at/api-reference/v2/<service>/<operation>, new ticket link/unlink endpoints have pages.Nav group labels
Mintlify labels auto-generated groups with the raw tag name (
DeploymentsService) and ignores ReDoc'sx-displayNameextension, which both specs already carry. Mintlify's equivalent isx-group, so the specs here mirrorx-displayNameintox-group(restores the familiar labels: "Deployment", "Supply Chain", …), and the refresh workflow (stacked PR #2706) applies the same one-line transform after fetching so the labels survive cron refreshes. Once semgrep-app emitsx-groupnatively, the transform step can be deleted.