Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add httpChecksumRequired test #869

Merged
merged 1 commit into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions smithy-aws-protocol-tests/model/restJson1/http-checksums.smithy
Original file line number Diff line number Diff line change
@@ -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"
}
}
])
3 changes: 3 additions & 0 deletions smithy-aws-protocol-tests/model/restJson1/main.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,8 @@ service RestJson {

// custom endpoints with paths
HostWithPathOperation,

// checksum(s)
HttpChecksumRequired,
]
}