-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20e4eea
commit 6ab6243
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
smithy-aws-protocol-tests/model/restJson1/http-checksums.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters