Repository navigation
chore(demo): check the stub against the API's OpenAPI spec - #73
Merged
Merged
Conversation
|
Claude finished @alukach's task in 11s —— View job ✅ No blocking issues, safe to merge. I read the diffs of Non-blocking notes:
Simplify (ponytail)
💰 Estimated review cost: $0.12 · 0m11s · 4 turns |
demo/check_stub.py starts the stub, requests each of its routes and
validates the answers against staging's OpenAPI spec. CI runs it on PRs
that change demo/.
It found drift, fixed here: accounts lacked fields the spec requires
(and demo-user wasn't in accounts, so its products embedded a bare ID),
data connection details lacked bucket, base_prefix and region, and the
stub answered GET /memberships/{id} and /products/featured, which the
CLI doesn't use (the latter in a shape the API doesn't).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alukach
force-pushed
the
chore/check-stub
branch
from
November 6, 2026 22:44
f7be6e5 to
f39e568
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.
Checks
demo/stub.pyagainst the API's OpenAPI spec, so the stub can't drift from the API unnoticed, and fixes the drift the check found.How it works
demo/check_stub.pystarts the stub, makes a request to each of its routes (filled in fromfixtures.json, including a 404 and a 409), and validates each answer against the spec's schema for that path, method and status. It fails if an answer doesn't match, or if the stub answers something the spec doesn't have. It prints one line per request..github/workflows/demo-stub.yml) runs it on pull requests that changedemo/, and by hand from the Actions tab. Demos are recorded in PRs that touchdemo/, so that's when drift would show up in one.cronline, so a weekly failure would most likely go unseen. If the API changes, the next PR that touchesdemo/fails the check.demo/README.mdandAGENTS.mdsay to run it and to add a request for each new route.AGENTS.mdnow points at staging's spec:https://source.coop/api/openapicurrently answers 500 with an empty body.Drift it found, fixed here
/whoamicreated_at,updated_at,identity_idandmetadata_publicaccountlackeddisabledandmetadata_public.demo-userwasn't inaccounts, so its products embedded a bare{"account_id"}with_account()gives the full public view;demo-useradded toaccounts/data-connectionsdetailswas just{"provider": "s3"}; the spec requiresbucket,base_prefixandregionGET /memberships/{id}/products/featured{"products": [...]}. The CLI uses/products?featured=trueinsteadStack
On top of #72, whose RFC 9457 errors are what the 404 and 409 checks expect. Merge #72 first.
Testing
check_stub.pypasses all 15 requests on this branch, against staging's spec.cargo test: 165 pass. No Rust changes.🤖 Generated with Claude Code