diff --git a/smithy-aws-protocol-tests/model/awsJson1_0/errors.smithy b/smithy-aws-protocol-tests/model/awsJson1_0/errors.smithy index 7da6a4b55a2..123b82b6467 100644 --- a/smithy-aws-protocol-tests/model/awsJson1_0/errors.smithy +++ b/smithy-aws-protocol-tests/model/awsJson1_0/errors.smithy @@ -58,6 +58,23 @@ apply InvalidGreeting @httpResponseTests([ }""", bodyMediaType: "application/json", }, + { + id: "AwsJson10FooErrorWithMultipleAmznErrorTypes", + documentation: """ + API Gateway always adds its own x-amzn-errortype header on gateway responses. + However, this header does not match the error configured in customers model and \ + results in two X-Amzn-Errortype header values. \ + The first value is provided by the customer and the second value is from API Gateway \ + + Clients need to split the header value on ',' and take only the first element. \ + For example, 'InvalidGreeting,InvalidParameterException' is to be interpreted as 'InvalidGreeting'.""", + protocol: awsJson1_0, + code: 400, + headers: { + "X-Amzn-Errortype": "InvalidGreeting,InvalidParameterException", + }, + appliesTo: "client", + }, ]) /// This error is thrown when a request is invalid. diff --git a/smithy-aws-protocol-tests/model/awsJson1_1/errors.smithy b/smithy-aws-protocol-tests/model/awsJson1_1/errors.smithy index c57b6fed010..f344ccb8a5f 100644 --- a/smithy-aws-protocol-tests/model/awsJson1_1/errors.smithy +++ b/smithy-aws-protocol-tests/model/awsJson1_1/errors.smithy @@ -51,6 +51,23 @@ apply InvalidGreeting @httpResponseTests([ }""", bodyMediaType: "application/json", }, + { + id: "AwsJson11FooErrorWithMultipleAmznErrorTypes", + documentation: """ + API-Gateway always adds its own x-amzn-errortype header on gateway responses. + However, this header does not match the error configured in customers model and \ + results in two X-Amzn-Errortype header values. \ + The first value is provided by the customer and the second value is from API Gateway \ + + Clients need to split the header value on ',' and take only the first element. \ + For example, 'InvalidGreeting,InvalidParameterException' is to be interpreted as 'InvalidGreeting'.""", + protocol: awsJson1_1, + code: 400, + headers: { + "X-Amzn-Errortype": "InvalidGreeting,InvalidParameterException", + }, + appliesTo: "client", + }, ]) /// This error is thrown when a request is invalid. diff --git a/smithy-aws-protocol-tests/model/restJson1/errors.smithy b/smithy-aws-protocol-tests/model/restJson1/errors.smithy index 7e387fe0363..b5a6f7a710b 100644 --- a/smithy-aws-protocol-tests/model/restJson1/errors.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/errors.smithy @@ -95,7 +95,23 @@ apply InvalidGreeting @httpResponseTests([ }""", bodyMediaType: "application/json", }, + { + id: "RestJsonWithMultipleAmznErrorTypes", + documentation: """ + API-Gateway always adds its own x-amzn-errortype header on gateway responses. + However, this header does not match the error configured in customers model and \ + results in two X-Amzn-Errortype header values. \ + The first value is provided by the customer and the second value is from API Gateway \ + Clients need to split the header value on ',' and take only the first element. \ + For example, 'InvalidGreeting,InvalidParameterException' is to be interpreted as 'InvalidGreeting'.""", + protocol: restJson1, + code: 400, + headers: { + "X-Amzn-Errortype": "InvalidGreeting,InvalidParameterException", + }, + appliesTo: "client", + } ]) /// This error is thrown when a request is invalid.