Repository navigation
fix(api): default request body to application/vnd.api+json - #160
Merged
shadowhand merged 1 commit intoOct 26, 2026
Merged
shadowhand merged 1 commit into
shadowhand merged 1 commit into
Conversation
rw api -f bodies now default to Content-Type: application/vnd.api+json, which JSON:API routes require. A Content-Type passed with -H still wins, matched case-insensitively.
shadowhand
force-pushed
the
feature/cl-10-rw-api-forces-content-type-applicationjson-and-ignores-h
branch
from
October 26, 2026 20:30
e94b8c7 to
1effbef
Compare
wweaver4th
approved these changes
Oct 26, 2026
shadowhand
deleted the
feature/cl-10-rw-api-forces-content-type-applicationjson-and-ignores-h
branch
October 26, 2026 21:13
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
rw api -f ...now defaults JSON bodies toContent-Type: application/vnd.api+json. It used to sendapplication/json, which RoundingWell API rejected.A Content-Type passed with
-Hstill wins, matched case-insensitively. Pass-H "Content-Type: application/json"to get the old behavior.Acceptstays at reqwest's*/*, which already accepts JSON:API responses. A strictapplication/vnd.api+jsondefault could break endpoints that return other media types. Callers can still pass-H "Accept: ...".Changes
src/commands/api.rs, the-fbody defaults toapplication/vnd.api+jsonunless-Hsets Content-Type.run()and check the Content-Type and body the server receives. They cover-fwith no-H,-H "Content-Type: application/json", a mixed-case header name, and an unrelated-H Accept.--fieldhelp text insrc/cli.rsnames the default media type.--header "Content-Type: application/json"override.Closes CL-10
Verification
cargo fmt --checkandcargo clippy --all-targets --all-features -- -D warningsare clean.cargo test --lockedpasses, andcargo auditreports no vulnerabilities.--stage local),-X PUT -f data.type=jobssentapplication/vnd.api+json, and adding-H "content-type: application/json"sentapplication/json.