Skip to content

Commit 4ca6b94

Browse files
authored
Remove reflected values from validation tests (#1622)
* Remove reflected values from validation tests * Test uniqueItems validation
1 parent e05b0fd commit 4ca6b94

8 files changed

+671
-101
lines changed

smithy-aws-protocol-tests/model/restJson1/validation/main.smithy

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ service RestJsonValidation {
2020
MalformedRange,
2121
MalformedRangeOverride,
2222
MalformedRequired,
23+
MalformedUniqueItems,
2324
RecursiveStructures,
2425
SensitiveValidation
2526
]

smithy-aws-protocol-tests/model/restJson1/validation/malformed-enum.smithy

+10-10
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ apply MalformedEnum @httpMalformedRequestTests([
3838
mediaType: "application/json",
3939
assertion: {
4040
contents: """
41-
{ "message" : "1 validation error detected. Value $value:L at '/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]",
42-
"fieldList" : [{"message": "Value $value:L at '/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]", "path": "/string"}]}"""
41+
{ "message" : "1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]",
42+
"fieldList" : [{"message": "Value at '/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]", "path": "/string"}]}"""
4343
}
4444
}
4545
},
@@ -71,8 +71,8 @@ apply MalformedEnum @httpMalformedRequestTests([
7171
mediaType: "application/json",
7272
assertion: {
7373
contents: """
74-
{ "message" : "1 validation error detected. Value $value:L at '/list/0' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]",
75-
"fieldList" : [{"message": "Value $value:L at '/list/0' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]", "path": "/list/0"}]}"""
74+
{ "message" : "1 validation error detected. Value at '/list/0' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]",
75+
"fieldList" : [{"message": "Value at '/list/0' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]", "path": "/list/0"}]}"""
7676
}
7777
}
7878
},
@@ -104,8 +104,8 @@ apply MalformedEnum @httpMalformedRequestTests([
104104
mediaType: "application/json",
105105
assertion: {
106106
contents: """
107-
{ "message" : "1 validation error detected. Value $value:L at '/map' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]",
108-
"fieldList" : [{"message": "Value $value:L at '/map' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]", "path": "/map"}]}"""
107+
{ "message" : "1 validation error detected. Value at '/map' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]",
108+
"fieldList" : [{"message": "Value at '/map' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]", "path": "/map"}]}"""
109109
}
110110
}
111111
},
@@ -137,8 +137,8 @@ apply MalformedEnum @httpMalformedRequestTests([
137137
mediaType: "application/json",
138138
assertion: {
139139
contents: """
140-
{ "message" : "1 validation error detected. Value $value:L at '/map/abc' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]",
141-
"fieldList" : [{"message": "Value $value:L at '/map/abc' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]", "path": "/map/abc"}]}"""
140+
{ "message" : "1 validation error detected. Value at '/map/abc' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]",
141+
"fieldList" : [{"message": "Value at '/map/abc' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]", "path": "/map/abc"}]}"""
142142
}
143143
}
144144
},
@@ -170,8 +170,8 @@ apply MalformedEnum @httpMalformedRequestTests([
170170
mediaType: "application/json",
171171
assertion: {
172172
contents: """
173-
{ "message" : "1 validation error detected. Value $value:L at '/union/first' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]",
174-
"fieldList" : [{"message": "Value $value:L at '/union/first' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]", "path": "/union/first"}]}"""
173+
{ "message" : "1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]",
174+
"fieldList" : [{"message": "Value at '/union/first' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]", "path": "/union/first"}]}"""
175175
}
176176
}
177177
},

smithy-aws-protocol-tests/model/restJson1/validation/malformed-pattern.smithy

+22-22
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ apply MalformedPattern @httpMalformedRequestTests([
4545
mediaType: "application/json",
4646
assertion: {
4747
contents: """
48-
{ "message" : "1 validation error detected. Value $value:L at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
49-
"fieldList" : [{"message": "Value $value:L at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/string"}]}"""
48+
{ "message" : "1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
49+
"fieldList" : [{"message": "Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/string"}]}"""
5050
}
5151
}
5252
},
@@ -78,8 +78,8 @@ apply MalformedPattern @httpMalformedRequestTests([
7878
mediaType: "application/json",
7979
assertion: {
8080
contents: """
81-
{ "message" : "1 validation error detected. Value $value:L at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
82-
"fieldList" : [{"message": "Value $value:L at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/string"}]}"""
81+
{ "message" : "1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
82+
"fieldList" : [{"message": "Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/string"}]}"""
8383
}
8484
}
8585
}
@@ -108,8 +108,8 @@ apply MalformedPattern @httpMalformedRequestTests([
108108
mediaType: "application/json",
109109
assertion: {
110110
contents: """
111-
{ "message" : "1 validation error detected. Value $value:L at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
112-
"fieldList" : [{"message": "Value $value:L at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/list/0"}]}"""
111+
{ "message" : "1 validation error detected. Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
112+
"fieldList" : [{"message": "Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/list/0"}]}"""
113113
}
114114
}
115115
},
@@ -141,8 +141,8 @@ apply MalformedPattern @httpMalformedRequestTests([
141141
mediaType: "application/json",
142142
assertion: {
143143
contents: """
144-
{ "message" : "1 validation error detected. Value $value:L at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
145-
"fieldList" : [{"message": "Value $value:L at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/map"}]}"""
144+
{ "message" : "1 validation error detected. Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
145+
"fieldList" : [{"message": "Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/map"}]}"""
146146
}
147147
}
148148
},
@@ -174,8 +174,8 @@ apply MalformedPattern @httpMalformedRequestTests([
174174
mediaType: "application/json",
175175
assertion: {
176176
contents: """
177-
{ "message" : "1 validation error detected. Value $value:L at '/map/abc' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
178-
"fieldList" : [{"message": "Value $value:L at '/map/abc' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/map/abc"}]}"""
177+
{ "message" : "1 validation error detected. Value at '/map/abc' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
178+
"fieldList" : [{"message": "Value at '/map/abc' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/map/abc"}]}"""
179179
}
180180
}
181181
},
@@ -207,8 +207,8 @@ apply MalformedPattern @httpMalformedRequestTests([
207207
mediaType: "application/json",
208208
assertion: {
209209
contents: """
210-
{ "message" : "1 validation error detected. Value $value:L at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
211-
"fieldList" : [{"message": "Value $value:L at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/union/first"}]}"""
210+
{ "message" : "1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$",
211+
"fieldList" : [{"message": "Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$$", "path": "/union/first"}]}"""
212212
}
213213
}
214214
},
@@ -245,8 +245,8 @@ apply MalformedPatternOverride @httpMalformedRequestTests([
245245
mediaType: "application/json",
246246
assertion: {
247247
contents: """
248-
{ "message" : "1 validation error detected. Value $value:L at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$",
249-
"fieldList" : [{"message": "Value $value:L at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$", "path": "/string"}]}"""
248+
{ "message" : "1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$",
249+
"fieldList" : [{"message": "Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$", "path": "/string"}]}"""
250250
}
251251
}
252252
},
@@ -278,8 +278,8 @@ apply MalformedPatternOverride @httpMalformedRequestTests([
278278
mediaType: "application/json",
279279
assertion: {
280280
contents: """
281-
{ "message" : "1 validation error detected. Value $value:L at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$",
282-
"fieldList" : [{"message": "Value $value:L at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$", "path": "/list/0"}]}"""
281+
{ "message" : "1 validation error detected. Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$",
282+
"fieldList" : [{"message": "Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$", "path": "/list/0"}]}"""
283283
}
284284
}
285285
},
@@ -311,8 +311,8 @@ apply MalformedPatternOverride @httpMalformedRequestTests([
311311
mediaType: "application/json",
312312
assertion: {
313313
contents: """
314-
{ "message" : "1 validation error detected. Value $value:L at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$",
315-
"fieldList" : [{"message": "Value $value:L at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$", "path": "/map"}]}"""
314+
{ "message" : "1 validation error detected. Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$",
315+
"fieldList" : [{"message": "Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$", "path": "/map"}]}"""
316316
}
317317
}
318318
},
@@ -344,8 +344,8 @@ apply MalformedPatternOverride @httpMalformedRequestTests([
344344
mediaType: "application/json",
345345
assertion: {
346346
contents: """
347-
{ "message" : "1 validation error detected. Value $value:L at '/map/ghi' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$",
348-
"fieldList" : [{"message": "Value $value:L at '/map/ghi' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$", "path": "/map/ghi"}]}"""
347+
{ "message" : "1 validation error detected. Value at '/map/ghi' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$",
348+
"fieldList" : [{"message": "Value at '/map/ghi' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$", "path": "/map/ghi"}]}"""
349349
}
350350
}
351351
},
@@ -377,8 +377,8 @@ apply MalformedPatternOverride @httpMalformedRequestTests([
377377
mediaType: "application/json",
378378
assertion: {
379379
contents: """
380-
{ "message" : "1 validation error detected. Value $value:L at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$",
381-
"fieldList" : [{"message": "Value $value:L at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$", "path": "/union/first"}]}"""
380+
{ "message" : "1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$",
381+
"fieldList" : [{"message": "Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$$", "path": "/union/first"}]}"""
382382
}
383383
}
384384
},

0 commit comments

Comments
 (0)