Skip to content

Commit 7eb3d05

Browse files
committed
Update NullAndEmptyHeaders protocol tests
This commit splits the NullAndEmpty headers protocol test in to two distinct operations, one tagged client-only and the other tagged server-only. This is done for both aws.rest-json-1.1 and aws.rest-xml.
1 parent ac93b25 commit 7eb3d05

File tree

4 files changed

+34
-12
lines changed

4 files changed

+34
-12
lines changed

smithy-aws-protocol-tests/model/rest-json/http-headers.smithy

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,19 +263,20 @@ structure InputAndOutputWithHeadersIO {
263263

264264
/// Null and empty headers are not sent over the wire.
265265
@readonly
266-
@http(uri: "/NullAndEmptyHeaders", method: "GET")
267-
operation NullAndEmptyHeaders {
266+
@http(uri: "/NullAndEmptyHeadersClient", method: "GET")
267+
@tags(["client-only"])
268+
operation NullAndEmptyHeadersClient {
268269
input: NullAndEmptyHeadersIO,
269270
output: NullAndEmptyHeadersIO
270271
}
271272

272-
apply NullAndEmptyHeaders @httpRequestTests([
273+
apply NullAndEmptyHeadersClient @httpRequestTests([
273274
{
274275
id: "RestJsonNullAndEmptyHeaders",
275276
documentation: "Do not send null values, empty strings, or empty lists over the wire in headers",
276277
protocol: "aws.rest-json-1.1",
277278
method: "GET",
278-
uri: "/NullAndEmptyHeaders",
279+
uri: "/NullAndEmptyHeadersClient",
279280
forbidHeaders: ["X-A", "X-B", "X-C"],
280281
body: "",
281282
params: {
@@ -286,7 +287,16 @@ apply NullAndEmptyHeaders @httpRequestTests([
286287
},
287288
])
288289

289-
apply NullAndEmptyHeaders @httpResponseTests([
290+
/// Null and empty headers are not sent over the wire.
291+
@readonly
292+
@http(uri: "/NullAndEmptyHeadersServer", method: "GET")
293+
@tags(["server-only"])
294+
operation NullAndEmptyHeadersServer {
295+
input: NullAndEmptyHeadersIO,
296+
output: NullAndEmptyHeadersIO
297+
}
298+
299+
apply NullAndEmptyHeadersServer @httpResponseTests([
290300
{
291301
id: "RestJsonNullAndEmptyHeaders",
292302
documentation: "Do not send null or empty headers",

smithy-aws-protocol-tests/model/rest-json/main.smithy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ service RestJson {
1919

2020
// @httpHeader tests
2121
InputAndOutputWithHeaders,
22-
NullAndEmptyHeaders,
22+
NullAndEmptyHeadersClient,
23+
NullAndEmptyHeadersServer,
2324
TimestampFormatHeaders,
2425

2526
// @httpLabel tests

smithy-aws-protocol-tests/model/rest-xml/http-headers.smithy

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,19 +263,20 @@ structure InputAndOutputWithHeadersIO {
263263

264264
/// Null and empty headers are not sent over the wire.
265265
@readonly
266-
@http(uri: "/NullAndEmptyHeaders", method: "GET")
267-
operation NullAndEmptyHeaders {
266+
@http(uri: "/NullAndEmptyHeadersClient", method: "GET")
267+
@tags(["client-only"])
268+
operation NullAndEmptyHeadersClient {
268269
input: NullAndEmptyHeadersIO,
269270
output: NullAndEmptyHeadersIO
270271
}
271272

272-
apply NullAndEmptyHeaders @httpRequestTests([
273+
apply NullAndEmptyHeadersClient @httpRequestTests([
273274
{
274275
id: "NullAndEmptyHeaders",
275276
documentation: "Do not send null values, empty strings, or empty lists over the wire in headers",
276277
protocol: "aws.rest-xml",
277278
method: "GET",
278-
uri: "/NullAndEmptyHeaders",
279+
uri: "/NullAndEmptyHeadersClient",
279280
forbidHeaders: ["X-A", "X-B", "X-C"],
280281
body: "",
281282
params: {
@@ -286,7 +287,16 @@ apply NullAndEmptyHeaders @httpRequestTests([
286287
},
287288
])
288289

289-
apply NullAndEmptyHeaders @httpResponseTests([
290+
/// Null and empty headers are not sent over the wire.
291+
@readonly
292+
@http(uri: "/NullAndEmptyHeadersServer", method: "GET")
293+
@tags(["server-only"])
294+
operation NullAndEmptyHeadersServer {
295+
input: NullAndEmptyHeadersIO,
296+
output: NullAndEmptyHeadersIO
297+
}
298+
299+
apply NullAndEmptyHeadersServer @httpResponseTests([
290300
{
291301
id: "NullAndEmptyHeaders",
292302
documentation: "Do not send null or empty headers",

smithy-aws-protocol-tests/model/rest-xml/main.smithy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ service RestXml {
1919

2020
// @httpHeader tests
2121
InputAndOutputWithHeaders,
22-
NullAndEmptyHeaders,
22+
NullAndEmptyHeadersClient,
23+
NullAndEmptyHeadersServer,
2324
TimestampFormatHeaders,
2425

2526
// @httpLabel tests

0 commit comments

Comments
 (0)