Skip to content

Commit 3335939

Browse files
landonxjamesMYoung25
authored andcommitted
Update NullAndEmptyHeadersServer tests (smithy-lang#2433)
The test now align with the similar tests for clients. They expect empty headers to be serialized as "" and null headers to not be serialized
1 parent 49f23f6 commit 3335939

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

smithy-aws-protocol-tests/model/restJson1/http-headers.smithy

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ structure InputAndOutputWithHeadersIO {
412412
headerIntegerEnumList: IntegerEnumList,
413413
}
414414

415-
/// Null and empty headers are not sent over the wire.
415+
/// Null headers are not sent over the wire, empty headers are serialized to ""
416416
@readonly
417417
@http(uri: "/NullAndEmptyHeadersClient", method: "GET")
418418
@tags(["client-only"])
@@ -443,7 +443,7 @@ apply NullAndEmptyHeadersClient @httpRequestTests([
443443
},
444444
])
445445

446-
/// Null and empty headers are not sent over the wire.
446+
/// Null headers are not sent over the wire, empty headers are serialized to ""
447447
@readonly
448448
@http(uri: "/NullAndEmptyHeadersServer", method: "GET")
449449
@tags(["server-only"])
@@ -455,10 +455,14 @@ operation NullAndEmptyHeadersServer {
455455
apply NullAndEmptyHeadersServer @httpResponseTests([
456456
{
457457
id: "RestJsonNullAndEmptyHeaders",
458-
documentation: "Do not send null or empty headers",
458+
documentation: "Do not send null values, but do send empty strings and empty lists over the wire in headers",
459459
protocol: restJson1,
460460
code: 200,
461-
forbidHeaders: ["X-A", "X-B", "X-C"],
461+
forbidHeaders: ["X-A"],
462+
headers: {
463+
"X-B": ""
464+
"X-C": ""
465+
}
462466
params: {
463467
a: null,
464468
b: "",

smithy-aws-protocol-tests/model/restXml/http-headers.smithy

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ structure InputAndOutputWithHeadersIO {
355355
headerEnumList: FooEnumList,
356356
}
357357

358-
/// Null and empty headers are not sent over the wire.
358+
/// Null headers are not sent over the wire, empty headers are serialized to ""
359359
@readonly
360360
@http(uri: "/NullAndEmptyHeadersClient", method: "GET")
361361
@tags(["client-only"])
@@ -386,7 +386,7 @@ apply NullAndEmptyHeadersClient @httpRequestTests([
386386
},
387387
])
388388

389-
/// Null and empty headers are not sent over the wire.
389+
/// Null headers are not sent over the wire, empty headers are serialized to ""
390390
@readonly
391391
@http(uri: "/NullAndEmptyHeadersServer", method: "GET")
392392
@tags(["server-only"])
@@ -398,10 +398,14 @@ operation NullAndEmptyHeadersServer {
398398
apply NullAndEmptyHeadersServer @httpResponseTests([
399399
{
400400
id: "NullAndEmptyHeaders",
401-
documentation: "Do not send null or empty headers",
401+
documentation: "Do not send null values, but do send empty strings and empty lists over the wire in headers",
402402
protocol: restXml,
403403
code: 200,
404-
forbidHeaders: ["X-A", "X-B", "X-C"],
404+
forbidHeaders: ["X-A"],
405+
headers: {
406+
"X-B": ""
407+
"X-C": ""
408+
}
405409
body: "",
406410
params: {
407411
a: null,

0 commit comments

Comments
 (0)