Skip to content

Commit f9285c3

Browse files
authored
codegen fix for protocol test generation (#1801)
* codegen fix for protocol test generation * empty changeset
1 parent 6161a04 commit f9285c3

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/core/src/submodules/cbor/CborCodec.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type { StaticSimpleSchema, StaticStructureSchema, StringSchema, Timestamp
33
import { describe, expect, it } from "vitest";
44

55
import { cbor } from "./cbor";
6-
import { CborCodec, CborShapeSerializer } from "./CborCodec";
76
import { tagSymbol } from "./cbor-types";
7+
import { CborCodec, CborShapeSerializer } from "./CborCodec";
88

99
describe(CborShapeSerializer.name, () => {
1010
const codec = new CborCodec();

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/HttpProtocolTestGenerator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ private void writeResponseTestSetup(OperationShape operation, HttpResponseTestCa
832832
writer.write("$L,", isSuccess);
833833
writer.write("$L,", testCase.getCode());
834834
if (headers.isEmpty()) {
835-
writer.write("undefined");
835+
writer.write("undefined,");
836836
} else {
837837
writer.openBlock("{", "},", () -> {
838838
for (Map.Entry<String, String> entry : headers.entrySet()) {
@@ -847,8 +847,9 @@ private void writeResponseTestSetup(OperationShape operation, HttpResponseTestCa
847847
});
848848
}
849849
if (body != null) {
850-
writer.write("`$L`", body);
850+
writer.write("`$L`,", body);
851851
}
852+
writer.unwrite(",\n").write("");
852853
});
853854
});
854855

0 commit comments

Comments
 (0)