Skip to content

Commit

Permalink
Update NullAndEmptyHeadersServer tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
landonxjames committed Oct 24, 2024
1 parent ce7b765 commit 056e316
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions smithy-aws-protocol-tests/model/restJson1/http-headers.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ structure InputAndOutputWithHeadersIO {
headerIntegerEnumList: IntegerEnumList,
}

/// Null and empty headers are not sent over the wire.
/// Null headers are not sent over the wire, empty headers are serialized to ""
@readonly
@http(uri: "/NullAndEmptyHeadersClient", method: "GET")
@tags(["client-only"])
Expand Down Expand Up @@ -443,7 +443,7 @@ apply NullAndEmptyHeadersClient @httpRequestTests([
},
])

/// Null and empty headers are not sent over the wire.
/// Null headers are not sent over the wire, empty headers are serialized to ""
@readonly
@http(uri: "/NullAndEmptyHeadersServer", method: "GET")
@tags(["server-only"])
Expand All @@ -455,10 +455,14 @@ operation NullAndEmptyHeadersServer {
apply NullAndEmptyHeadersServer @httpResponseTests([
{
id: "RestJsonNullAndEmptyHeaders",
documentation: "Do not send null or empty headers",
documentation: "Do not send null values, but do send empty strings and empty lists over the wire in headers",
protocol: restJson1,
code: 200,
forbidHeaders: ["X-A", "X-B", "X-C"],
forbidHeaders: ["X-A"],
headers: {
"X-B": ""
"X-C": ""
}
params: {
a: null,
b: "",
Expand Down
12 changes: 8 additions & 4 deletions smithy-aws-protocol-tests/model/restXml/http-headers.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ structure InputAndOutputWithHeadersIO {
headerEnumList: FooEnumList,
}

/// Null and empty headers are not sent over the wire.
/// Null headers are not sent over the wire, empty headers are serialized to ""
@readonly
@http(uri: "/NullAndEmptyHeadersClient", method: "GET")
@tags(["client-only"])
Expand Down Expand Up @@ -386,7 +386,7 @@ apply NullAndEmptyHeadersClient @httpRequestTests([
},
])

/// Null and empty headers are not sent over the wire.
/// Null headers are not sent over the wire, empty headers are serialized to ""
@readonly
@http(uri: "/NullAndEmptyHeadersServer", method: "GET")
@tags(["server-only"])
Expand All @@ -398,10 +398,14 @@ operation NullAndEmptyHeadersServer {
apply NullAndEmptyHeadersServer @httpResponseTests([
{
id: "NullAndEmptyHeaders",
documentation: "Do not send null or empty headers",
documentation: "Do not send null values, but do send empty strings and empty lists over the wire in headers",
protocol: restXml,
code: 200,
forbidHeaders: ["X-A", "X-B", "X-C"],
forbidHeaders: ["X-A"],
headers: {
"X-B": ""
"X-C": ""
}
body: "",
params: {
a: null,
Expand Down

0 comments on commit 056e316

Please sign in to comment.