diff --git a/smithy-aws-protocol-tests/model/restJson1/http-checksums.smithy b/smithy-aws-protocol-tests/model/restJson1/http-checksums.smithy new file mode 100644 index 00000000000..71b5cbfd708 --- /dev/null +++ b/smithy-aws-protocol-tests/model/restJson1/http-checksums.smithy @@ -0,0 +1,43 @@ +// This file defines test cases that test HTTP checksum trait(s). +// See: https://awslabs.github.io/smithy/1.0/spec/core/behavior-traits.html#httpchecksumrequired-trait +$version: "1.0" + +namespace aws.protocoltests.restjson + +use aws.protocols#restJson1 +use smithy.test#httpRequestTests + +/// This example tests httpChecksumRequired trait +@httpChecksumRequired +@http(uri: "/HttpChecksumRequired", method: "POST") +operation HttpChecksumRequired { + input: HttpChecksumRequiredInputOutput, + output: HttpChecksumRequiredInputOutput +} + +structure HttpChecksumRequiredInputOutput{ + foo: String +} + +apply HttpChecksumRequired @httpRequestTests([ + { + id: "RestJsonHttpChecksumRequired", + documentation: "Adds Content-MD5 header", + protocol: restJson1, + method: "POST", + uri: "/HttpChecksumRequired", + body: """ + { + "foo":"base64 encoded md5 checksum" + } + """, + bodyMediaType: "application/json", + headers: { + "Content-Type": "application/json", + "Content-MD5": "iB0/3YSo7maijL0IGOgA9g==" + }, + params: { + foo: "base64 encoded md5 checksum" + } + } +]) diff --git a/smithy-aws-protocol-tests/model/restJson1/main.smithy b/smithy-aws-protocol-tests/model/restJson1/main.smithy index c7e2ff38d5b..18744e02d02 100644 --- a/smithy-aws-protocol-tests/model/restJson1/main.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/main.smithy @@ -89,5 +89,8 @@ service RestJson { // custom endpoints with paths HostWithPathOperation, + + // checksum(s) + HttpChecksumRequired, ] }