-
Notifications
You must be signed in to change notification settings - Fork 218
/
empty-input-output.smithy
115 lines (100 loc) · 3.2 KB
/
empty-input-output.smithy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// This file defines test cases that test the basics of empty input and
// output shape serialization.
$version: "2.0"
namespace aws.protocoltests.query
use aws.protocols#awsQuery
use smithy.test#httpRequestTests
use smithy.test#httpResponseTests
/// The example tests how requests and responses are serialized when there's
/// no request or response payload because the operation has no input or output.
///
/// While this should be rare, code generators must support this.
operation NoInputAndNoOutput {}
apply NoInputAndNoOutput @httpRequestTests([
{
id: "QueryNoInputAndNoOutput",
documentation: "No input serializes no additional query params",
protocol: awsQuery,
method: "POST",
uri: "/",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: "Action=NoInputAndNoOutput&Version=2020-01-08",
bodyMediaType: "application/x-www-form-urlencoded"
}
])
apply NoInputAndNoOutput @httpResponseTests([
{
id: "QueryNoInputAndNoOutput",
documentation: "Empty output. Note that no assertion is made on the output body itself.",
protocol: awsQuery,
code: 200,
}
])
/// The example tests how requests and responses are serialized when there's
/// no request payload or response members.
///
/// While this should be rare, code generators must support this.
operation NoInputAndOutput {
input: NoInputAndOutputInput,
output: NoInputAndOutputOutput
}
apply NoInputAndOutput @httpRequestTests([
{
id: "QueryNoInputAndOutput",
documentation: "No input serializes no payload",
protocol: awsQuery,
method: "POST",
uri: "/",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: "Action=NoInputAndOutput&Version=2020-01-08",
bodyMediaType: "application/x-www-form-urlencoded"
}
])
apply NoInputAndOutput @httpResponseTests([
{
id: "QueryNoInputAndOutput",
documentation: "Empty output",
protocol: awsQuery,
code: 200,
}
])
@input
structure NoInputAndOutputInput {}
@output
structure NoInputAndOutputOutput {}
/// The example tests how requests and responses are serialized when there's
/// no request or response members.
///
/// While this should be rare, code generators must support this.
operation EmptyInputAndEmptyOutput {
input: EmptyInputAndEmptyOutputInput,
output: EmptyInputAndEmptyOutputOutput
}
apply EmptyInputAndEmptyOutput @httpRequestTests([
{
id: "QueryEmptyInputAndEmptyOutput",
documentation: "Empty input serializes no extra query params",
protocol: awsQuery,
method: "POST",
uri: "/",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: "Action=EmptyInputAndEmptyOutput&Version=2020-01-08",
bodyMediaType: "application/x-www-form-urlencoded"
},
])
apply EmptyInputAndEmptyOutput @httpResponseTests([
{
id: "QueryEmptyInputAndEmptyOutput",
documentation: "Empty output",
protocol: awsQuery,
code: 200,
},
])
structure EmptyInputAndEmptyOutputInput {}
structure EmptyInputAndEmptyOutputOutput {}