Repository navigation
feat(api): -q for query parameters, one typed -f, and -F for a body file - #56
Merged
Merged
Conversation
…file `source-coop api` took gh's flags: -f string fields, -F typed fields, and --input for a body, with fields moving to the query string only under -X GET. Now: - -q/--query KEY=VALUE adds a query parameter and never changes the method. - -f/--field KEY=VALUE sets a body field, sent as JSON when the value parses as JSON (arrays and objects too), as a string otherwise. - -F/--from-file PATH (- for stdin) reads the body, like product's -F; -f fields override its keys. The method is GET, or POST when there's a body. `api` hasn't been released yet, so the old flags aren't kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude finished @alukach's task in 16s —— View job ✅ No blocking issues — safe to merge. I read the diff for
Non-blocking note: Simplify (ponytail)
💰 Estimated review cost: $0.13 · 0m16s · 6 turns |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rints `api --help` now says where its paths and fields are listed (the OpenAPI spec at /api/openapi), that the response is printed as JSON without --json, and which exit code each failure gets. Its summary says it's for what the other commands don't cover, and the top-level 'For scripts and agents' section mentions api, since --json there doesn't apply to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rendered from defaults::API_URL, so a staging build points at staging's spec, and without the aside about other deployments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
source-coop apicopiedgh api's flags, so query parameters needed-X GETplus fields, and there were two field flags that differed only in typing. This PR splits query and body the way HTTPie does, and makes-Fmean the same as inproduct:-q, --query KEY=VALUE-f, --field KEY=VALUE5,true,["a"]), as a string otherwise.'"5"'forces a string.-F, --from-file PATH-for stdin).-ffields override its keys. Same precedence asproduct create/edit -F.-X, --methodGET, orPOSTwhen there's a body. AGETwith a body is refused.The old
--raw-field, typed-Fand--inputare removed rather than kept as hidden aliases, becauseapi(#45) hasn't been in a release yet.api --helpnow has examples, and the README's "Any API request" section is rewritten to match.Help for agents:
api --helpnow points to the OpenAPI spec (<api-url>/api/openapi) for paths and fields, and says the response is printed as JSON without--jsonand which exit code each failure gets. The top-level "For scripts and agents" section mentionsapitoo. The spec is live on staging. Production will have it before this ships.Testing
cargo fmt --checkandcargo clippy --all-targets -- -D warnings: cleancargo testandcargo test --features staging: 111 passed each"5"as a string),-foverriding-F's keys,-qkeeping aGET, and aGETrefusing a body.🤖 Generated with Claude Code