Repository navigation
fix: leave the container limit to the API, and release a spec sync only when the CLI changes - #53
Merged
yiichou merged 3 commits intoOct 16, 2026
Conversation
The CLI sends request bodies as given, so a change to a body schema moves nothing it does: only its tests read those schemas. spec-diff titled such a sync a feat all the same, and the first sync of the English spec would have released a version with no change in it and a changelog line saying otherwise. A sync is now a feat when the method, path or parameters of an operation the CLI calls change, or a list of values a flag reads with choices or bodyChoices; spec-diff reads those lookups off the source and stops on one that does not name its operation and field in literals, which is why the refund and payout options now take their lists from the call site. A body, an operation the CLI does not call, or prose is a chore. Refs: #T17509 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
entry count refused an eleventh container before sending. The limit is in openapi.yaml's prose, not its schema, so the CLI kept its own copy of it, and that copy would go on refusing after the API took more. The API answers more than it takes with a 400 that says so. The help still says up to 10. Refs: #T17509 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The payment commands' help named order, refund and payout numbers and the payment channels in Chinese; openapi.yaml now names them in English, with the parameter each one is: trade_no, merchant_out_trade_no, out_trade_no, refund_no. 小金商户 stays, as the spec keeps it. Refs: #T17509 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Test resultsUnit tests. 1. When a sync releases. I ran the steps of
2.
3. Payment commands. I built #51 and this branch and compared them:
The test account has no 小金商户, so the live payment calls answer 404. A raw request with |
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.
Stacked on #51. Once #51 is merged, this needs a rebase onto
main.Why
The published openapi.yaml is now in English. Running the sync locally against it showed one problem in #51. The new spec also changes several request bodies (
random_choiceson the choice fields, a newGoodsItemUpdateInput, keys moved withinFieldUpdateInput), sospec-difftitled the syncfeat: follow openapi.yaml changes to createForm, createTable, updateForm and 1 more. But the CLI sends bodies as given, so those schemas change nothing it does; only its tests read them. Merging that sync would have cut a release with no change in it, and a changelog line saying otherwise.Comparing the two specs also turned up a container limit the CLI kept a copy of, and help text still naming payment numbers in Chinese.
What changed
spec-diffdecidesfeatfrom what the CLI does with the spec at run time. A sync is afeatwhen the method, path or parameters of an operation the CLI calls change, or a list of values a flag reads withchoices/bodyChoices. A request body, an operation the CLI does not call, or prose is achore.spec-diffreads the lookups off the source and stops if one does not name its operation and field in literals, so the refund/payout options now pass the lookup from the call site.src/spec-diff.test.tscovers each case against the spec in the checkout.entry countno longer refuses an eleventh container. The API states the limit of 10 in its prose, not its schema, so the CLI's copy would keep refusing after the API took more. The API answers with a 400 that says so. The help still says up to 10.trade_no/merchant_out_trade_no/out_trade_no,refund_no, payouts. 小金商户 stays, as the spec keeps it.Against the English spec
With these changes, the sync of the current published spec comes out as:
npm run checkand all tests also pass with that spec in place of the bundled one, so the firstworkflow_dispatchafter merge should open a greenchorePR.Noticed, not changed here
The spec says "Required." in the description of
metrics(the four aggregate operations) andform_tokens(countEntriesAcrossForms) but hasrequired: falsein their schema. If it marks them required,call()checks them for free.Testing
npm run checkandnpm test(282 tests) pass on each of the three commits.Refs: #T17509
🤖 Generated with Claude Code