fix: repair Chainhooks API reference by vendoring its OpenAPI spec - #1149
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
leah-stacks
approved these changes
Jul 31, 2026
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.
What & why
The Chainhooks API reference pages (e.g.
/apis/chainhooks-api/reference/chainhooks/register-chainhook) render broken. The build fetched the chainhook OpenAPI spec fromhttps://chainhooks-api.vercel.app/openapi.json, but that deployment is gone. The fetch failed, soopenapi/chainhook-api.jsonwas never produced and every<APIPage>in the chainhooks reference had no document to render.The legitimate spec lives in a private repo, so it can't be fetched at build time like the other (public) specs.
Changes
scripts/vendored-specs/chainhook-api.json(bundled/dereferenced from the private repo'sopenapi.yaml), tracked in git.scripts/fetch-openapi-specs.mts— removed the deadchainhooks-api.vercel.appURL fromAPI_SPECS, and added aVENDORED_SPECSlist +copyVendoredSpec()step that copies each vendored spec intoopenapi/<name>-api.jsonduringgenerate, before markdown generation.openapi/stays fully gitignored (purely generated).Verification
bun run generatesucceeds with no chainhook fetch error; copies the spec into place and produces the 12 chainhook markdown files.register-chainhookpage (and get/delete/evaluate/secrets/status) render at 200 with the correctPOST /me/operation, cURL example, request body, and 200 response schema.openapi/remains gitignored; onlyscripts/vendored-specs/chainhook-api.jsonis tracked.Notes for reviewers
chainhooks-api.vercel.appdeployment has been claimed by a third party (bug-bounty POC). Removing our dependency closes the docs exposure, but the takeover itself should be reported/reclaimed internally.scripts/vendored-specs/chainhook-api.jsonfromstx-labs/chainhookspackages/api/openapi.yamlwhen the API changes. A longer-term option is publishing that spec to a public URL and repointing the fetch script.🤖 Generated with Claude Code