Skip to content

Commit e35f78c

Browse files
authored
chore(codegen): bump smithy to 1.15.x (#3091)
1 parent 943dab0 commit e35f78c

File tree

3 files changed

+86
-7
lines changed

3 files changed

+86
-7
lines changed

codegen/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ allprojects {
3131
version = "0.8.0"
3232
}
3333

34-
extra["smithyVersion"] = "[1.14.0,1.15.0["
34+
extra["smithyVersion"] = "[1.15.0,1.16.0["
3535

3636
// The root project doesn't produce a JAR.
3737
tasks["jar"].enabled = false

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ private static boolean filterProtocolTests(
298298
if (testCase.getId().equals("QueryCustomizedError")) {
299299
return true;
300300
}
301+
301302
// TODO: Remove when server protocol tests are fixed in
302303
// https://github.com/aws/aws-sdk-js-v3/issues/3058
303304
// TODO: Move to filter specific to server protocol tests if added in
@@ -306,6 +307,19 @@ private static boolean filterProtocolTests(
306307
|| testCase.getId().equals("RestJsonHttpWithHeadersButNoPayload")) {
307308
return true;
308309
}
310+
311+
// TODO: remove when there's a decision on separator to use
312+
// https://github.com/awslabs/smithy/issues/1014
313+
if (testCase.getId().equals("RestJsonInputAndOutputWithQuotedStringHeaders")) {
314+
return true;
315+
}
316+
317+
// TODO: remove when there's a decision on behavior for list of timestamps.
318+
// https://github.com/awslabs/smithy/issues/1015
319+
if (testCase.getId().equals("RestJsonInputAndOutputWithTimestampHeaders")) {
320+
return true;
321+
}
322+
309323
return false;
310324
}
311325

private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,6 +2957,38 @@ it("RestJsonInputAndOutputWithStringHeaders:Request", async () => {
29572957
}
29582958
});
29592959

2960+
/**
2961+
* Tests requests with string list header bindings that require quoting
2962+
*/
2963+
it.skip("RestJsonInputAndOutputWithQuotedStringHeaders:Request", async () => {
2964+
const client = new RestJsonProtocolClient({
2965+
...clientParams,
2966+
requestHandler: new RequestSerializationTestHandler(),
2967+
});
2968+
2969+
const command = new InputAndOutputWithHeadersCommand({
2970+
headerStringList: ["b,c", '"def"', "a"],
2971+
} as any);
2972+
try {
2973+
await client.send(command);
2974+
fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
2975+
return;
2976+
} catch (err) {
2977+
if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
2978+
fail(err);
2979+
return;
2980+
}
2981+
const r = err.request;
2982+
expect(r.method).toBe("POST");
2983+
expect(r.path).toBe("/InputAndOutputWithHeaders");
2984+
2985+
expect(r.headers["x-stringlist"]).toBeDefined();
2986+
expect(r.headers["x-stringlist"]).toBe('"b,c",""def"",a');
2987+
2988+
expect(r.body).toBeFalsy();
2989+
}
2990+
});
2991+
29602992
/**
29612993
* Tests requests with numeric header bindings
29622994
*/
@@ -3062,7 +3094,7 @@ it("RestJsonInputAndOutputWithBooleanHeaders:Request", async () => {
30623094
/**
30633095
* Tests requests with timestamp header bindings
30643096
*/
3065-
it("RestJsonInputAndOutputWithTimestampHeaders:Request", async () => {
3097+
it.skip("RestJsonInputAndOutputWithTimestampHeaders:Request", async () => {
30663098
const client = new RestJsonProtocolClient({
30673099
...clientParams,
30683100
requestHandler: new RequestSerializationTestHandler(),
@@ -3085,7 +3117,7 @@ it("RestJsonInputAndOutputWithTimestampHeaders:Request", async () => {
30853117
expect(r.path).toBe("/InputAndOutputWithHeaders");
30863118

30873119
expect(r.headers["x-timestamplist"]).toBeDefined();
3088-
expect(r.headers["x-timestamplist"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT");
3120+
expect(r.headers["x-timestamplist"]).toBe('"Mon, 16 Dec 2019 23:48:18 GMT", "Mon, 16 Dec 2019 23:48:18 GMT"');
30893121

30903122
expect(r.body).toBeFalsy();
30913123
}
@@ -3274,6 +3306,39 @@ it("RestJsonInputAndOutputWithStringHeaders:Response", async () => {
32743306
});
32753307
});
32763308

3309+
/**
3310+
* Tests responses with string list header bindings that require quoting
3311+
*/
3312+
it.skip("RestJsonInputAndOutputWithQuotedStringHeaders:Response", async () => {
3313+
const client = new RestJsonProtocolClient({
3314+
...clientParams,
3315+
requestHandler: new ResponseDeserializationTestHandler(true, 200, {
3316+
"x-stringlist": '"b,c",""def"",a',
3317+
}),
3318+
});
3319+
3320+
const params: any = {};
3321+
const command = new InputAndOutputWithHeadersCommand(params);
3322+
3323+
let r: any;
3324+
try {
3325+
r = await client.send(command);
3326+
} catch (err) {
3327+
fail("Expected a valid response to be returned, got err.");
3328+
return;
3329+
}
3330+
expect(r["$metadata"].httpStatusCode).toBe(200);
3331+
const paramsToValidate: any = [
3332+
{
3333+
headerStringList: ["a", "b,c", '"def"'],
3334+
},
3335+
][0];
3336+
Object.keys(paramsToValidate).forEach((param) => {
3337+
expect(r[param]).toBeDefined();
3338+
expect(equivalentContents(r[param], paramsToValidate[param])).toBe(true);
3339+
});
3340+
});
3341+
32773342
/**
32783343
* Tests responses with numeric header bindings
32793344
*/
@@ -3373,11 +3438,11 @@ it("RestJsonInputAndOutputWithBooleanHeaders:Response", async () => {
33733438
/**
33743439
* Tests responses with timestamp header bindings
33753440
*/
3376-
it("RestJsonInputAndOutputWithTimestampHeaders:Response", async () => {
3441+
it.skip("RestJsonInputAndOutputWithTimestampHeaders:Response", async () => {
33773442
const client = new RestJsonProtocolClient({
33783443
...clientParams,
33793444
requestHandler: new ResponseDeserializationTestHandler(true, 200, {
3380-
"x-timestamplist": "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT",
3445+
"x-timestamplist": '"Mon, 16 Dec 2019 23:48:18 GMT", "Mon, 16 Dec 2019 23:48:18 GMT"',
33813446
}),
33823447
});
33833448

@@ -7722,8 +7787,6 @@ it.skip("RestJsonTestPayloadStructure:Request", async () => {
77227787
});
77237788

77247789
const command = new TestPayloadStructureCommand({
7725-
testId: "t-12345",
7726-
77277790
payloadConfig: {
77287791
data: 25,
77297792
} as any,
@@ -7782,6 +7845,8 @@ it.skip("RestJsonHttpWithHeadersButNoPayload:Request", async () => {
77827845

77837846
expect(r.headers["content-type"]).toBeDefined();
77847847
expect(r.headers["content-type"]).toBe("application/json");
7848+
expect(r.headers["x-amz-test-id"]).toBeDefined();
7849+
expect(r.headers["x-amz-test-id"]).toBe("t-12345");
77857850

77867851
expect(r.body).toBeDefined();
77877852
const utf8Encoder = client.config.utf8Encoder;

0 commit comments

Comments
 (0)