Skip to content

Commit

Permalink
allow bytes input with encoding (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft authored Feb 7, 2024
1 parent 0306f01 commit 987fdcd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/polite-schools-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@azure-tools/typespec-client-generator-core": none
---

fix diagnostic for multipart bytes input with encoding
2 changes: 1 addition & 1 deletion packages/typespec-client-generator-core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ function getSdkBodyModelPropertyType(
const isBytesInput =
base.type.kind === "bytes" ||
(base.type.kind === "array" && base.type.valueType.kind === "bytes");
if (isBytesInput && getEncode(context.program, type)) {
if (isBytesInput && operationIsMultipart && getEncode(context.program, type)) {
reportDiagnostic(context.program, {
code: "encoding-multipart-bytes",
target: type,
Expand Down

0 comments on commit 987fdcd

Please sign in to comment.