Loading codegen-core/common-test-models/rest-json-extras.smithy +24 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,30 @@ use smithy.test#httpRequestTests use smithy.test#httpResponseTests use smithy.framework#ValidationException // TODO(https://github.com/smithy-lang/smithy/pull/2132): 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", Loading codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocolTestGenerator.kt +2 −54 Original line number Diff line number Diff line Loading @@ -812,6 +812,8 @@ class ServerProtocolTestGenerator( FailingTest(RestJson, "RestJsonEndpointTrait", TestType.Request), FailingTest(RestJson, "RestJsonEndpointTraitWithHostLabel", TestType.Request), FailingTest(RestJson, "RestJsonOmitsEmptyListQueryValues", TestType.Request), // TODO(https://github.com/smithy-lang/smithy/pull/2132): 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), Loading Loading @@ -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, Loading gradle.properties +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading rust-runtime/aws-smithy-types/src/blob.rs +1 −1 Original line number Diff line number Diff line Loading @@ -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<u8>, } Loading Loading
codegen-core/common-test-models/rest-json-extras.smithy +24 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,30 @@ use smithy.test#httpRequestTests use smithy.test#httpResponseTests use smithy.framework#ValidationException // TODO(https://github.com/smithy-lang/smithy/pull/2132): 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", Loading
codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/protocol/ServerProtocolTestGenerator.kt +2 −54 Original line number Diff line number Diff line Loading @@ -812,6 +812,8 @@ class ServerProtocolTestGenerator( FailingTest(RestJson, "RestJsonEndpointTrait", TestType.Request), FailingTest(RestJson, "RestJsonEndpointTraitWithHostLabel", TestType.Request), FailingTest(RestJson, "RestJsonOmitsEmptyListQueryValues", TestType.Request), // TODO(https://github.com/smithy-lang/smithy/pull/2132): 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), Loading Loading @@ -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, Loading
gradle.properties +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
rust-runtime/aws-smithy-types/src/blob.rs +1 −1 Original line number Diff line number Diff line Loading @@ -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<u8>, } Loading