diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index f0e2ced331..ed13671732 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -98,3 +98,8 @@ references = ["smithy-rs#1935"] meta = { "breaking" = true, "tada" = false, "bug" = false } author = "jdisanti" +[[smithy-rs]] +message = "Upgrade to Smithy 1.26.2" +references = ["smithy-rs#1972"] +meta = { "breaking" = false, "tada" = false, "bug" = false } +author = "rcoh" diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocolTestGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocolTestGenerator.kt index 32cd165d9a..01120f4fc9 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocolTestGenerator.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocolTestGenerator.kt @@ -903,7 +903,6 @@ class ServerProtocolTestGenerator( private val ExpectFail: Set = setOf( // Pending merge from the Smithy team: see https://github.com/awslabs/smithy/pull/1477. FailingTest(RestJson, "RestJsonWithPayloadExpectsImpliedContentType", TestType.MalformedRequest), - FailingTest(RestJson, "RestJsonBodyMalformedMapNullKey", TestType.MalformedRequest), // Pending resolution from the Smithy team, see https://github.com/awslabs/smithy/issues/1068. FailingTest(RestJson, "RestJsonHttpWithHeadersButNoPayload", TestType.Request), diff --git a/gradle.properties b/gradle.properties index 091ab5acd8..2d45a41459 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ kotlin.code.style=official # codegen smithyGradlePluginVersion=0.6.0 -smithyVersion=1.26.0 +smithyVersion=1.26.2 # kotlin kotlinVersion=1.6.21 diff --git a/rust-runtime/aws-smithy-query/src/lib.rs b/rust-runtime/aws-smithy-query/src/lib.rs index 67c0d2ee1d..3b9d57a9d0 100644 --- a/rust-runtime/aws-smithy-query/src/lib.rs +++ b/rust-runtime/aws-smithy-query/src/lib.rs @@ -34,6 +34,7 @@ impl<'a> QueryWriter<'a> { } } +#[must_use] pub struct QueryMapWriter<'a> { output: &'a mut String, prefix: Cow<'a, str>, @@ -89,6 +90,7 @@ impl<'a> QueryMapWriter<'a> { } } +#[must_use] pub struct QueryListWriter<'a> { output: &'a mut String, prefix: Cow<'a, str>, @@ -132,10 +134,15 @@ impl<'a> QueryListWriter<'a> { } pub fn finish(self) { - // Calling this drops self + // https://github.com/awslabs/smithy/commit/715b1d94ab14764ad43496b016b0c2e85bcf1d1f + // If the list was empty, just serialize the parameter name + if self.next_index == 1 { + QueryValueWriter::new(self.output, self.prefix).write_param_name(); + } } } +#[must_use] pub struct QueryValueWriter<'a> { output: &'a mut String, prefix: Cow<'a, str>, @@ -229,6 +236,15 @@ mod tests { assert_eq!("Action=SomeAction&Version=1.0", out); } + #[test] + fn query_list_writer_empty_list() { + let mut out = String::new(); + let mut writer = QueryWriter::new(&mut out, "SomeAction", "1.0"); + writer.prefix("myList").start_list(false, None).finish(); + writer.finish(); + assert_eq!("Action=SomeAction&Version=1.0&myList=", out); + } + #[test] fn maps() { let mut out = String::new();