Repository navigation
fix(http-client-java): honor response replacements #12156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Weidong Xu (weidongxu-microsoft)
merged 11 commits into
microsoft:main
from
weidongxu-microsoft:java-new-spector-coverage-10-12
Oct 13, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
46b8280
fix(http-client-java): honor response replacements
weidongxu-microsoft caf0d3d
test(http-client-java): cover response replacements in _specs_
weidongxu-microsoft 1385d76
refactor(http-client-java): clarify response replacement by flavor
weidongxu-microsoft 964a271
refactor(http-client-java): centralize response replacement handling
weidongxu-microsoft 2515d82
refactor(http-client-java): separate raw bytes from file detection
weidongxu-microsoft c809bc2
refactor(http-client-java): inline bytes replacement condition
weidongxu-microsoft 7fb6e91
fix(http-client-java): handle optional and bodyless response replacem…
weidongxu-microsoft 8989a02
docs(http-client-java): remove manual README changes
weidongxu-microsoft 4592051
test(http-client-java): remove response replacement Spector test
weidongxu-microsoft e8d76f3
fix(http-client-java): preserve response headers and raw text bytes
weidongxu-microsoft 1794de8
chore(http-client-java): merge latest main
weidongxu-microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| changeKind: fix | ||
| packages: | ||
| - "@typespec/http-client-java" | ||
| --- | ||
|
|
||
| Honor void and raw-byte response replacements in generated Java clients, preserving types used by typed response headers. Fix raw-byte conversion for text responses. |
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
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
13 changes: 13 additions & 0 deletions
13
...-client-java/emitter/src/diagnostics/bytes-response-replacement-without-body.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| This warning is issued when `replaceResponseWithBytes` targets an operation with no declared HTTP response body. | ||
|
|
||
| ## Impact | ||
|
|
||
| The emitter cannot fabricate response bytes. It ignores the response type override and preserves the original response type in all Java flavors. | ||
|
|
||
| ## How to Fix | ||
|
|
||
| Remove the bytes replacement, or declare the HTTP response body if the service actually returns one. | ||
|
|
||
| ## Suppression | ||
|
|
||
| Suppressing this warning does not enable the replacement; the original response type is still used. |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.