Repository navigation
fix(http-client-js): allow none encoding on bytes without unknown-encoding diagnostic - #12371
Open
Akash Sarangi (Roxen-AS) wants to merge 5 commits into
Open
Akash Sarangi (Roxen-AS) wants to merge 5 commits into
Akash Sarangi (Roxen-AS) wants to merge 5 commits into
Conversation
…oding diagnostic (microsoft#12356) Signed-off-by: Roxen-AS <akash.arjun12@gmail.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The unsupported-encoding test does not trigger its expected diagnostic, and response-side warning regression coverage is missing.
2 open issues
What changed in this PR
Fixes #12356 by treating "none" as a supported byte encoding in the JavaScript HTTP client emitter, avoiding warnings for raw binary bodies.
Changes:
- Adds passthrough handling for byte serialization and deserialization.
- Adds tests for binary-body diagnostics and unsupported encodings.
- Adds a Chronus fix entry.
| File | Description |
|---|---|
packages/http-client-js/test/bytes-none-encoding.test.ts |
Adds encoding diagnostic tests. |
packages/http-client-js/src/components/transforms/scalar-transform.tsx |
Handles "none" encoding in both transform directions. |
.chronus/changes/fix-http-client-js-bytes-none-encoding.md |
Documents the warning fix. |
Review effort: Balanced
…lar for unsupported encoding Signed-off-by: Roxen-AS <akash.arjun12@gmail.com>
…body transform Signed-off-by: Roxen-AS <akash.arjun12@gmail.com>
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
Jeff Fisher (xirzec)
approved these changes
Oct 23, 2026
Jeff Fisher (xirzec)
left a comment
Member
There was a problem hiding this comment.
Overall, a good change, but I'd appreciate the commented cleanups before merging.
…w feedback Signed-off-by: Roxen-AS <akash.arjun12@gmail.com>
Jeff Fisher (xirzec)
enabled auto-merge
October 30, 2026 20:23
Jeff Fisher (xirzec)
disabled auto-merge
October 30, 2026 20:23
Timothee Guerin (timotheeguerin)
approved these changes
Oct 30, 2026
This branch has not been deployed
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.


Fixes #12356
Description
When a
bytesbody is used with a binary content type (such asapplication/octet-stream), the compiler sets the default byte encoding to"none". However,@typespec/http-client-js'sscalar-transform.tsxonly explicitly handled"base64"and"base64url", falling through to emit anunknown-encodingwarning for"none".This PR:
case "none": return passthroughTransformer(itemRef);in bothtoTransportandtoApplicationbyte transforms inscalar-transform.tsx.bytesbody and binary content type emits cleanly without anyunknown-encodingdiagnostics.