feat(cards): add CARD_LIMIT_REACHED to the 409 error vocabulary - #895
feat(cards): add CARD_LIMIT_REACHED to the 409 error vocabulary#895DhruvPareek wants to merge 1 commit into
Conversation
Grid is gaining a per-platform cap on how many live cards a platform may hold. Error409.code is a closed enum, so an SDK consumer deserializing the rejection would fail validation on an undocumented code; the spec has to carry it before the enforcement ships. Also documents the 409 response on POST /cards, which until now listed no 409 at all despite the endpoint already returning CONFLICT for idempotency-key collisions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dsva2mXndRoAfUMb3vQCc
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
✱ Stainless preview builds for gridThis PR will update the cli chore(internal): regenerate SDK with no functional changes docs(api): document card issuance limits in card issue method feat(api): add 409 response and CARD_LIMIT_REACHED error to createCard docs(api): document card limit restrictions in cards issue method docs(api): document card limit behavior in cards create method docs(api): add card limit documentation to cards create method docs(api): document card limit behavior in cards issue method ✅ grid-openapi studio · code · diff
⏳ grid-cli studio✅ grid-ruby studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-go studio · code · diff
✅ grid-python studio · code · diff
✅ grid-php studio · code · diff
⏳ These are partial results; builds are still running. This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Greptile SummaryThis PR extends the 409 error vocabulary with CARD_LIMIT_REACHED and documents conflict responses for card issuance.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking documentation inconsistency around the per-cardholder CARD_LIMIT_REACHED trigger. The contract additions are resolvable and synchronized across source and generated specifications, but POST /cards documents fewer CARD_LIMIT_REACHED conditions than its referenced shared error schema. Files Needing Attention: openapi/paths/cards/cards.yaml, openapi/components/schemas/errors/Error409.yaml
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/errors/Error409.yaml | Adds CARD_LIMIT_REACHED to the closed 409 enum and describes both platform-wide and per-cardholder limit triggers. |
| openapi/paths/cards/cards.yaml | Adds card-cap documentation and a 409 response, but omits the per-cardholder trigger included in the referenced schema. |
| openapi.yaml | Correctly mirrors the modular schema and path changes in the assembled OpenAPI contract. |
| mintlify/openapi.yaml | Correctly mirrors the assembled OpenAPI changes for published documentation. |
Prompt To Fix All With AI
### Issue 1
openapi/paths/cards/cards.yaml:90-93
**Document the per-cardholder trigger**
The shared `Error409` schema says `CARD_LIMIT_REACHED` also applies when a platform allows only one card per cardholder, but the new `POST /cards` description and 409 response mention only the platform-wide live-card cap. Integrators relying on the operation documentation therefore receive this error under an undocumented condition.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(cards): add CARD_LIMIT_REACHED to t..." | Re-trigger Greptile
| reached the maximum number of live cards it may hold, and with | ||
| `CONFLICT` when the `Idempotency-Key` was already used for a | ||
| different card request. Closing a card frees its slot; contact | ||
| Lightspark to raise the limit. |
There was a problem hiding this comment.
Document the per-cardholder trigger
The shared Error409 schema says CARD_LIMIT_REACHED also applies when a platform allows only one card per cardholder, but the new POST /cards description and 409 response mention only the platform-wide live-card cap. Integrators relying on the operation documentation therefore receive this error under an undocumented condition.
Knowledge Base Used: Cards API
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/cards/cards.yaml
Line: 90-93
Comment:
**Document the per-cardholder trigger**
The shared `Error409` schema says `CARD_LIMIT_REACHED` also applies when a platform allows only one card per cardholder, but the new `POST /cards` description and 409 response mention only the platform-wide live-card cap. Integrators relying on the operation documentation therefore receive this error under an undocumented condition.
**Knowledge Base Used:** [Cards API](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/cards-api.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Reason
Grid is gaining a per-platform cap on how many live cards a platform may hold — a waitlist-style control so platforms can be onboarded to production card issuance a few cards at a time, with the allowance raised as they graduate.
Error409.codeis a closed enum in the generated SDKs, so a client deserializing a rejection carrying an undocumented code fails validation instead of surfacing the error. The spec has to carryCARD_LIMIT_REACHEDbefore the enforcement ships in sparkcore.Overview
Error409.yaml— addsCARD_LIMIT_REACHEDto the code enum and its description table.paths/cards/cards.yaml— documents the cap in thePOST /cardsdescription, and adds the409response, which the endpoint had no entry for at all despite already returningCONFLICTfor idempotency-key collisions.openapi.yaml/mintlify/openapi.yamlbundles.Enforcement semantics the copy reflects: the cap counts live cards, so closing a card frees its slot, and
CLOSEDcards never count.Test Plan
make build— bundle regenerates cleanly; the diff is limited to the two additions plus the new response block.make lint— passes with0 errors(901 pre-existing warnings/infos, unchanged by this PR).🤖 Generated with Claude Code
https://claude.ai/code/session_012dsva2mXndRoAfUMb3vQCc