-
Notifications
You must be signed in to change notification settings - Fork 218
/
required.smithy
178 lines (142 loc) · 3.65 KB
/
required.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
$version: "2.0"
namespace aws.protocoltests.json10
use aws.protocols#awsJson1_0
use smithy.test#httpResponseTests
apply OperationWithRequiredMembers @httpResponseTests([
{
id: "AwsJson10ClientErrorCorrectsWhenServerFailsToSerializeRequiredValues"
documentation: "Client error corrects when server fails to serialize required values."
appliesTo: "client"
tags: ["defaults", "error-correction"]
protocol: awsJson1_0
code: 200
bodyMediaType: "application/json"
headers: {"Content-Type": "application/x-amz-json-1.0"}
body: "{}"
params: {
requiredString: ""
requiredBoolean: false
requiredList: []
requiredTimestamp: 0
requiredBlob: ""
requiredByte: 0
requiredShort: 0
requiredInteger: 0
requiredLong: 0
requiredFloat: 0.0
requiredDouble: 0.0
requiredMap: {}
}
}
])
operation OperationWithRequiredMembers {
output := with [RequiredMembersMixin] {
}
}
apply OperationWithRequiredMembersWithDefaults @httpResponseTests([
{
id: "AwsJson10ClientErrorCorrectsWithDefaultValuesWhenServerFailsToSerializeRequiredValues"
documentation: "Client error corrects with default values when server fails to serialize required values."
appliesTo: "client"
tags: ["defaults", "error-correction"]
protocol: awsJson1_0
code: 200
bodyMediaType: "application/json"
headers: {"Content-Type": "application/x-amz-json-1.0"}
body: "{}"
params: {
requiredString: "hi"
requiredBoolean: true
requiredList: []
requiredTimestamp: 1
requiredBlob: "{}"
requiredByte: 1
requiredShort: 1
requiredInteger: 10
requiredLong: 100
requiredFloat: 1.0
requiredDouble: 1.0
requiredMap: {}
requiredEnum: "FOO"
requiredIntEnum: 1
}
}
])
operation OperationWithRequiredMembersWithDefaults {
output := with [RequiredMembersWithDefaultsMixin] {
}
}
@mixin
structure RequiredMembersMixin {
@required
requiredString: String
@required
requiredBoolean: Boolean
@required
requiredList: RequiredStringList
@required
requiredTimestamp: Timestamp
@required
requiredBlob: Blob
@required
requiredByte: Byte
@required
requiredShort: Short
@required
requiredInteger: Integer
@required
requiredLong: Long
@required
requiredFloat: Float
@required
requiredDouble: Double
@required
requiredMap: RequiredStringMap
}
@mixin
structure RequiredMembersWithDefaultsMixin {
@required
requiredString: String = "hi"
@required
requiredBoolean: Boolean = true
@required
requiredList: RequiredStringList = []
@required
requiredTimestamp: Timestamp = 1
@required
requiredBlob: Blob = "{}"
@required
requiredByte: Byte = 1
@required
requiredShort: Short = 1
@required
requiredInteger: Integer = 10
@required
requiredLong: Long = 100
@required
requiredFloat: Float = 1.0
@required
requiredDouble: Double = 1.0
@required
requiredMap: RequiredStringMap = {}
@required
requiredEnum: RequiredEnum = "FOO"
@required
requiredIntEnum: RequiredIntEnum = 1
}
list RequiredStringList {
member: String
}
map RequiredStringMap {
key: String
value: String
}
enum RequiredEnum {
FOO
BAR
BAZ
}
intEnum RequiredIntEnum {
ONE = 1
TWO = 2
}