Skip to content

Commit 2262051

Browse files
committed
chore(codegen): update smithy-ts commit hash
1 parent bf7405e commit 2262051

7 files changed

Lines changed: 212 additions & 2 deletions

File tree

private/aws-protocoltests-json-10-schema/test/functional/awsjson1_0.spec.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,42 @@ it("AwsJson10FooErrorWithDunderTypeAndNamespace:Error:GreetingWithErrors", async
783783
fail("Expected an exception to be thrown from response");
784784
});
785785

786+
/**
787+
* Because only the part after '#' is considered, an unrecognized namespace should not make a difference.
788+
*/
789+
it("AwsJson10FooErrorWithDunderTypeAndDifferentNamespace:Error:GreetingWithErrors", async () => {
790+
const client = new JSONRPC10Client({
791+
...clientParams,
792+
requestHandler: new ResponseDeserializationTestHandler(
793+
false,
794+
500,
795+
{
796+
"content-type": "application/x-amz-json-1.0",
797+
},
798+
`{
799+
"__type": "aws.different.namespace#FooError"
800+
}`
801+
),
802+
});
803+
804+
const params: any = {};
805+
const command = new GreetingWithErrorsCommand(params);
806+
807+
try {
808+
await client.send(command);
809+
} catch (err) {
810+
if (err.name !== "FooError") {
811+
console.log(err);
812+
fail(`Expected a FooError to be thrown, got ${err.name} instead`);
813+
return;
814+
}
815+
const r: any = err;
816+
expect(r.$metadata.httpStatusCode).toBe(500);
817+
return;
818+
}
819+
fail("Expected an exception to be thrown from response");
820+
});
821+
786822
/**
787823
* Some services serialize errors using __type, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service.
788824
*/

private/aws-protocoltests-json-10/test/functional/awsjson1_0.spec.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,42 @@ it("AwsJson10FooErrorWithDunderTypeAndNamespace:Error:GreetingWithErrors", async
783783
fail("Expected an exception to be thrown from response");
784784
});
785785

786+
/**
787+
* Because only the part after '#' is considered, an unrecognized namespace should not make a difference.
788+
*/
789+
it("AwsJson10FooErrorWithDunderTypeAndDifferentNamespace:Error:GreetingWithErrors", async () => {
790+
const client = new JSONRPC10Client({
791+
...clientParams,
792+
requestHandler: new ResponseDeserializationTestHandler(
793+
false,
794+
500,
795+
{
796+
"content-type": "application/x-amz-json-1.0",
797+
},
798+
`{
799+
"__type": "aws.different.namespace#FooError"
800+
}`
801+
),
802+
});
803+
804+
const params: any = {};
805+
const command = new GreetingWithErrorsCommand(params);
806+
807+
try {
808+
await client.send(command);
809+
} catch (err) {
810+
if (err.name !== "FooError") {
811+
console.log(err);
812+
fail(`Expected a FooError to be thrown, got ${err.name} instead`);
813+
return;
814+
}
815+
const r: any = err;
816+
expect(r.$metadata.httpStatusCode).toBe(500);
817+
return;
818+
}
819+
fail("Expected an exception to be thrown from response");
820+
});
821+
786822
/**
787823
* Some services serialize errors using __type, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service.
788824
*/

private/aws-protocoltests-json-schema/test/functional/awsjson1_1.spec.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,42 @@ it("AwsJson11FooErrorWithDunderTypeAndNamespace:Error:GreetingWithErrors", async
10481048
fail("Expected an exception to be thrown from response");
10491049
});
10501050

1051+
/**
1052+
* Because only the part after '#' is considered, an unrecognized namespace should not make a difference.
1053+
*/
1054+
it("AwsJson11FooErrorWithDunderTypeAndDifferentNamespace:Error:GreetingWithErrors", async () => {
1055+
const client = new JsonProtocolClient({
1056+
...clientParams,
1057+
requestHandler: new ResponseDeserializationTestHandler(
1058+
false,
1059+
500,
1060+
{
1061+
"content-type": "application/x-amz-json-1.1",
1062+
},
1063+
`{
1064+
"__type": "aws.different.namespace#FooError"
1065+
}`
1066+
),
1067+
});
1068+
1069+
const params: any = {};
1070+
const command = new GreetingWithErrorsCommand(params);
1071+
1072+
try {
1073+
await client.send(command);
1074+
} catch (err) {
1075+
if (err.name !== "FooError") {
1076+
console.log(err);
1077+
fail(`Expected a FooError to be thrown, got ${err.name} instead`);
1078+
return;
1079+
}
1080+
const r: any = err;
1081+
expect(r.$metadata.httpStatusCode).toBe(500);
1082+
return;
1083+
}
1084+
fail("Expected an exception to be thrown from response");
1085+
});
1086+
10511087
/**
10521088
* Some services serialize errors using __type, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service.
10531089
*/

private/aws-protocoltests-json/test/functional/awsjson1_1.spec.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,42 @@ it("AwsJson11FooErrorWithDunderTypeAndNamespace:Error:GreetingWithErrors", async
10481048
fail("Expected an exception to be thrown from response");
10491049
});
10501050

1051+
/**
1052+
* Because only the part after '#' is considered, an unrecognized namespace should not make a difference.
1053+
*/
1054+
it("AwsJson11FooErrorWithDunderTypeAndDifferentNamespace:Error:GreetingWithErrors", async () => {
1055+
const client = new JsonProtocolClient({
1056+
...clientParams,
1057+
requestHandler: new ResponseDeserializationTestHandler(
1058+
false,
1059+
500,
1060+
{
1061+
"content-type": "application/x-amz-json-1.1",
1062+
},
1063+
`{
1064+
"__type": "aws.different.namespace#FooError"
1065+
}`
1066+
),
1067+
});
1068+
1069+
const params: any = {};
1070+
const command = new GreetingWithErrorsCommand(params);
1071+
1072+
try {
1073+
await client.send(command);
1074+
} catch (err) {
1075+
if (err.name !== "FooError") {
1076+
console.log(err);
1077+
fail(`Expected a FooError to be thrown, got ${err.name} instead`);
1078+
return;
1079+
}
1080+
const r: any = err;
1081+
expect(r.$metadata.httpStatusCode).toBe(500);
1082+
return;
1083+
}
1084+
fail("Expected an exception to be thrown from response");
1085+
});
1086+
10511087
/**
10521088
* Some services serialize errors using __type, and it might contain a namespace. It also might contain a URI. Clients should just take the last part of the string after '#' and before ":". This is a pathalogical case that might not occur in any deployed AWS service.
10531089
*/

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,39 @@ it("RestJsonFooErrorUsingXAmznErrorTypeWithUriAndNamespace:Error:GreetingWithErr
22072207
fail("Expected an exception to be thrown from response");
22082208
});
22092209

2210+
/**
2211+
* Because namespace and URL are ignored, an unrecognized namespace should not make a difference.
2212+
*/
2213+
it("RestJsonFooErrorUsingXAmznErrorTypeWithUriAndDifferentNamespace:Error:GreetingWithErrors", async () => {
2214+
const client = new RestJsonProtocolClient({
2215+
...clientParams,
2216+
requestHandler: new ResponseDeserializationTestHandler(
2217+
false,
2218+
500,
2219+
{
2220+
"x-amzn-errortype": "aws.different.namespace#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/",
2221+
}
2222+
),
2223+
});
2224+
2225+
const params: any = {};
2226+
const command = new GreetingWithErrorsCommand(params);
2227+
2228+
try {
2229+
await client.send(command);
2230+
} catch (err) {
2231+
if (err.name !== "FooError") {
2232+
console.log(err);
2233+
fail(`Expected a FooError to be thrown, got ${err.name} instead`);
2234+
return;
2235+
}
2236+
const r: any = err;
2237+
expect(r.$metadata.httpStatusCode).toBe(500);
2238+
return;
2239+
}
2240+
fail("Expected an exception to be thrown from response");
2241+
});
2242+
22102243
/**
22112244
* This example uses the 'code' property in the output rather than X-Amzn-Errortype. Some services do this though it's preferable to send the X-Amzn-Errortype. Client implementations must first check for the X-Amzn-Errortype and then check for a top-level 'code' property.
22122245
*

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,39 @@ it("RestJsonFooErrorUsingXAmznErrorTypeWithUriAndNamespace:Error:GreetingWithErr
22072207
fail("Expected an exception to be thrown from response");
22082208
});
22092209

2210+
/**
2211+
* Because namespace and URL are ignored, an unrecognized namespace should not make a difference.
2212+
*/
2213+
it("RestJsonFooErrorUsingXAmznErrorTypeWithUriAndDifferentNamespace:Error:GreetingWithErrors", async () => {
2214+
const client = new RestJsonProtocolClient({
2215+
...clientParams,
2216+
requestHandler: new ResponseDeserializationTestHandler(
2217+
false,
2218+
500,
2219+
{
2220+
"x-amzn-errortype": "aws.different.namespace#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/",
2221+
}
2222+
),
2223+
});
2224+
2225+
const params: any = {};
2226+
const command = new GreetingWithErrorsCommand(params);
2227+
2228+
try {
2229+
await client.send(command);
2230+
} catch (err) {
2231+
if (err.name !== "FooError") {
2232+
console.log(err);
2233+
fail(`Expected a FooError to be thrown, got ${err.name} instead`);
2234+
return;
2235+
}
2236+
const r: any = err;
2237+
expect(r.$metadata.httpStatusCode).toBe(500);
2238+
return;
2239+
}
2240+
fail("Expected an exception to be thrown from response");
2241+
});
2242+
22102243
/**
22112244
* This example uses the 'code' property in the output rather than X-Amzn-Errortype. Some services do this though it's preferable to send the X-Amzn-Errortype. Client implementations must first check for the X-Amzn-Errortype and then check for a top-level 'code' property.
22122245
*

scripts/generate-clients/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
module.exports = {
33
// Use full commit hash as we explicitly fetch it.
44
// Comparison link (update with previous hash):
5-
// https://github.com/smithy-lang/smithy-typescript/compare/9e76e52a04da3929c18e5930a2246a8de2099a62...29ad40ae33b8e2e242b33fcd6e6dfeda7fcec2c6
6-
SMITHY_TS_COMMIT: "29ad40ae33b8e2e242b33fcd6e6dfeda7fcec2c6",
5+
// https://github.com/smithy-lang/smithy-typescript/compare/3c14866b08c9527b6262000f4194b84ce35a3e80...12ba20a9a09d3b68ba222907d1e5a6807adc0c09
6+
SMITHY_TS_COMMIT: "12ba20a9a09d3b68ba222907d1e5a6807adc0c09",
77
};
88

99
if (module.exports.SMITHY_TS_COMMIT.length < 40) {

0 commit comments

Comments
 (0)