Repository navigation
fix(types): billing_fee_amount, EstimatedAnnualRevenue, Rail; contract-check allow-list - #69
Merged
Merged
Conversation
- PayinOut.billing_fee_amount was typed string but the spec has always
declared it number; fix the type (matches every other amount-in-cents
field on Payin).
- EstimatedAnnualRevenue's top tier literal had an extra zero
("2500000000_plus" vs spec's "250000000_plus"); the old value was
always rejected by the API, so this corrects a value nobody could use.
- Rail was missing "sepa", even though the SDK already implements SEPA
bank-account creation (createSepa/CreateSepaInput).
- Drop the three .api-sync/unmodeled.json known-divergence entries these
fixes resolve.
- Add an allow-list entry for CreatePayoutInput.reference: v2 PR #1925
prunes unreachable schemas from the public spec, and once node's spec
snapshot syncs to that pruned spec this field stops matching anywhere
else, tripping contract-check. Downgrade the "stale allow-list entry"
check from a hard failure to a warning so a forward-looking entry like
this one, added ahead of the spec-sync that makes it necessary,
doesn't break CI in the meantime.
Claude-Session: https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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
Task 1 (defect fixes, verified against
current-openapi.public.json):PayinOut.billing_fee_amountwas typedstring | null; spec saysnumber | null. Fixed tonumber | nullinsrc/resources/payins/index.ts.EstimatedAnnualRevenue's top tier was"2500000000_plus"(extra zero); spec's value is"250000000_plus". The old literal was always rejected by the API (python's SDK made the same fix in its chore(deps): bump svix to 1.99.1 and cover webhook signature verification #66), so this is a fix, not a break.Railwas missing"sepa"even though the SDK already implements SEPA bank-account creation (createSepa/CreateSepaInput). Added..api-sync/unmodeled.json(knownDivergences):BankAccountWebhookOut.typesepa gap,PayinOut.billing_fee_amounttype-mismatch,UpdateCustomerIn.estimated_annual_revenuevalue-mismatch.bun run audit:typesdelta (againstcurrent-openapi.public.json): 513 -> 504 findings (9 resolved: 2 Rail/sepa enum gaps, 6 EstimatedAnnualRevenue value-mismatch gaps across Create/Update/Out customer types, 1 billing_fee_amount type-kind-mismatch).Task 2 (contract-check allow-list for the upcoming v2 spec prune):
CreatePayoutInput.reference(schemaCreatePayoutInput, fieldreference). v2 PR #1925 prunes unreachable schemas from the public spec; todayreferencestill exists elsewhere in the spec (InvoiceItemSchema, which #1925 also prunes as unreachable) so this field passes today, but once node's.api-sync/spec-snapshot.jsonsyncs to the pruned spec,referencedisappears from the spec entirely and contract-check would fail on this one stale SDK field. Note in the entry: stale surface, remove in next major.scripts/contract-check.mjs) from a hard failure to a non-blocking warning, so a forward-looking, disclosed entry like this doesn't block merges while it's between "added" and "needed". Unused entries are still surfaced for cleanup, just not gating.Verified both ways by swapping
.api-sync/spec-snapshot.jsoncontent locally (not committed) and runningnode scripts/contract-check.mjs:pruned-openapi.public.json: passes (exit 0), 28 allow-list entries in use.current-openapi.public.json(== the actual committed snapshot, byte-identical): still passes (exit 0), with the new entry reported only as an informational "not currently needed yet" warning.Test plan
bun installbun run test(163 tests, 27 files, all pass)bun run check-types(clean)bun run lint:check(clean)bun run audit:typesbefore/after delta captured abovenode scripts/contract-check.mjsagainst both current and pruned spec snapshots (see above)https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs