diff --git a/codegen-core/common-test-models/rest-json-extras.smithy b/codegen-core/common-test-models/rest-json-extras.smithy index a4ff54af966..536f5959d8f 100644 --- a/codegen-core/common-test-models/rest-json-extras.smithy +++ b/codegen-core/common-test-models/rest-json-extras.smithy @@ -8,6 +8,30 @@ use smithy.test#httpRequestTests use smithy.test#httpResponseTests use smithy.framework#ValidationException +// TODO: Remove this test once it's fixed in Smithy +apply AllQueryStringTypes @httpRequestTests([ + { + id: "RestJsonZeroAndFalseQueryValuesFixed" + documentation: "Query values of 0 and false are serialized" + protocol: restJson1 + method: "GET" + uri: "/AllQueryStringTypesInput" + body: "" + queryParams: [ + "Integer=0" + "Boolean=false" + ] + params: { + queryInteger: 0 + queryBoolean: false + queryParamsMapOfStringList: { + queryInteger: ["0"] + queryBoolean: ["false"] + } + } + } +]) + apply QueryPrecedence @httpRequestTests([ { id: "UrlParamsKeyEncoding", 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 b9cb2f533e0..2633fd5765d 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 @@ -812,6 +812,8 @@ class ServerProtocolTestGenerator( FailingTest(RestJson, "RestJsonEndpointTrait", TestType.Request), FailingTest(RestJson, "RestJsonEndpointTraitWithHostLabel", TestType.Request), FailingTest(RestJson, "RestJsonOmitsEmptyListQueryValues", TestType.Request), + // TODO: Remove this failing test once it's fixed in Smithy + FailingTest(RestJson, "RestJsonZeroAndFalseQueryValues", TestType.Request), // Tests involving `@range` on floats. // Pending resolution from the Smithy team, see https://github.com/smithy-lang/smithy-rs/issues/2007. FailingTest(RestJsonValidation, "RestJsonMalformedRangeFloat_case0", TestType.MalformedRequest), @@ -912,60 +914,6 @@ class ServerProtocolTestGenerator( "S3EscapePathObjectKeyInUriLabel", ) - private fun fixRestJsonAllQueryStringTypes( - testCase: HttpRequestTestCase, - @Suppress("UNUSED_PARAMETER") - operationShape: OperationShape, - ): HttpRequestTestCase = - testCase.toBuilder().params( - Node.parse( - """ - { - "queryString": "Hello there", - "queryStringList": ["a", "b", "c"], - "queryStringSet": ["a", "b", "c"], - "queryByte": 1, - "queryShort": 2, - "queryInteger": 3, - "queryIntegerList": [1, 2, 3], - "queryIntegerSet": [1, 2, 3], - "queryLong": 4, - "queryFloat": 1.1, - "queryDouble": 1.1, - "queryDoubleList": [1.1, 2.1, 3.1], - "queryBoolean": true, - "queryBooleanList": [true, false, true], - "queryTimestamp": 1, - "queryTimestampList": [1, 2, 3], - "queryEnum": "Foo", - "queryIntegerEnum": 1, - "queryIntegerEnumList": [1,2,3], - "queryEnumList": ["Foo", "Baz", "Bar"], - "queryParamsMapOfStringList": { - "String": ["Hello there"], - "StringList": ["a", "b", "c"], - "StringSet": ["a", "b", "c"], - "Byte": ["1"], - "Short": ["2"], - "Integer": ["3"], - "IntegerList": ["1", "2", "3"], - "IntegerSet": ["1", "2", "3"], - "Long": ["4"], - "Float": ["1.1"], - "Double": ["1.1"], - "DoubleList": ["1.1", "2.1", "3.1"], - "Boolean": ["true"], - "BooleanList": ["true", "false", "true"], - "Timestamp": ["1970-01-01T00:00:01Z"], - "TimestampList": ["1970-01-01T00:00:01Z", "1970-01-01T00:00:02Z", "1970-01-01T00:00:03Z"], - "Enum": ["Foo"], - "EnumList": ["Foo", "Baz", "Bar"] - } - } - """.trimMargin(), - ).asObjectNode().get(), - ).build() - // TODO(https://github.com/awslabs/smithy/issues/1506) private fun fixRestJsonMalformedPatternReDOSString( testCase: HttpMalformedRequestTestCase, diff --git a/gradle.properties b/gradle.properties index 71f5254c827..2c8b5ab29ac 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ kotlin.code.style=official # codegen smithyGradlePluginVersion=0.9.0 -smithyVersion=1.43.0 +smithyVersion=1.44.0 # kotlin kotlinVersion=1.9.20 diff --git a/rust-runtime/aws-smithy-types/src/blob.rs b/rust-runtime/aws-smithy-types/src/blob.rs index eebdd60ca21..7f76a45df3b 100644 --- a/rust-runtime/aws-smithy-types/src/blob.rs +++ b/rust-runtime/aws-smithy-types/src/blob.rs @@ -6,7 +6,7 @@ /// Binary Blob Type /// /// Blobs represent protocol-agnostic binary content. -#[derive(Debug, PartialEq, Eq, Hash, Clone)] +#[derive(Debug, Default, PartialEq, Eq, Hash, Clone)] pub struct Blob { inner: Vec, }