diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 28c00a184d..32012b1023 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -22,3 +22,9 @@ message = "Bump [MSRV](https://github.com/awslabs/aws-sdk-rust#supported-rust-ve references = ["smithy-rs#1318"] meta = { "breaking" = true, "tada" = false, "bug" = false } author = "Velfi" + +[[smithy-rs]] +message = "Upgrade to Smithy 1.21.0" +references = ["smithy-rs#1330"] +meta = { "breaking" = false, "tada" = false, "bug" = false } +author = "jdisanti" diff --git a/aws/sdk-codegen/build.gradle.kts b/aws/sdk-codegen/build.gradle.kts index 8a8fb3b8e7..6634364c2a 100644 --- a/aws/sdk-codegen/build.gradle.kts +++ b/aws/sdk-codegen/build.gradle.kts @@ -108,9 +108,5 @@ publishing { artifact(sourcesJar) } } - repositories { - maven { - url = uri("$buildDir/repository") - } - } + repositories { maven { url = uri("$buildDir/repository") } } } diff --git a/build.gradle.kts b/build.gradle.kts index e5eb24bc62..212fdfc699 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,6 +4,7 @@ */ buildscript { repositories { + mavenCentral() google() } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index de9070afa1..62abe841ac 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -11,7 +11,8 @@ plugins { jacoco } repositories { - maven("https://plugins.gradle.org/m2") + mavenCentral() + google() } // Load properties manually to avoid hard coding smithy version @@ -21,12 +22,6 @@ val props = Properties().apply { val smithyVersion = props["smithyVersion"] -buildscript { - repositories { - mavenCentral() - } -} - dependencies { api("software.amazon.smithy:smithy-codegen-core:$smithyVersion") implementation("software.amazon.smithy:smithy-utils:$smithyVersion") 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 96faa29fcf..75a3675a57 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 @@ -356,7 +356,7 @@ class ServerProtocolTestGenerator( // corresponding Unicode code point. That is the "form feed" 0x0c character. When printing it, // it gets written as "\f", which is an invalid Rust escape sequence: https://static.rust-lang.org/doc/master/reference.html#literals // So we need to write the corresponding Rust Unicode escape sequence to make the program compile. - "#{SmithyHttpServer}::body::Body::from(#{Bytes}::from_static(b${body.replace("\u000c", "\\u{000c}").dq()}))" + "#{SmithyHttpServer}::body::Body::from(#{Bytes}::from_static(${body.replace("\u000c", "\\u{000c}").dq()}.as_bytes()))" } else { "#{SmithyHttpServer}::body::Body::empty()" } @@ -652,13 +652,13 @@ class ServerProtocolTestGenerator( private val ExpectFail = setOf( // Headers. FailingTest(RestJson, "RestJsonHttpWithHeadersButNoPayload", TestType.Request), - FailingTest(RestJson, "RestJsonInputAndOutputWithQuotedStringHeaders", TestType.Response), FailingTest(RestJson, "RestJsonEndpointTrait", TestType.Request), FailingTest(RestJson, "RestJsonEndpointTraitWithHostLabel", TestType.Request), FailingTest(RestJson, "RestJsonStreamingTraitsRequireLengthWithBlob", TestType.Response), FailingTest(RestJson, "RestJsonHttpWithEmptyBlobPayload", TestType.Request), FailingTest(RestJson, "RestJsonHttpWithEmptyStructurePayload", TestType.Request), + FailingTest(RestJson, "RestJsonHttpResponseCodeDefaultsToModeledCode", TestType.Response), FailingTest(RestJson, "RestJsonWithBodyExpectsApplicationJsonAccept", TestType.MalformedRequest), FailingTest(RestJson, "RestJsonWithPayloadExpectsImpliedAccept", TestType.MalformedRequest), @@ -708,6 +708,7 @@ class ServerProtocolTestGenerator( FailingTest(RestJson, "RestJsonPathTimestampDefaultRejectsUTCOffsets", TestType.MalformedRequest), FailingTest(RestJson, "RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case13", TestType.MalformedRequest), FailingTest(RestJson, "RestJsonMalformedUnionNoFieldsSet", TestType.MalformedRequest), + FailingTest(RestJson, "RestJsonMalformedSetDuplicateBlobs", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedEnumList_case0", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedEnumList_case1", TestType.MalformedRequest), @@ -727,6 +728,7 @@ class ServerProtocolTestGenerator( FailingTest(RestJsonValidation, "RestJsonMalformedLengthMapOverride_case1", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedLengthStringOverride_case0", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedLengthStringOverride_case1", TestType.MalformedRequest), + FailingTest(RestJsonValidation, "RestJsonMalformedLengthStringOverride_case2", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedLengthBlob_case0", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedLengthBlob_case1", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedLengthList_case0", TestType.MalformedRequest), @@ -741,6 +743,7 @@ class ServerProtocolTestGenerator( FailingTest(RestJsonValidation, "RestJsonMalformedLengthMapValue_case1", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedLengthString_case0", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedLengthString_case1", TestType.MalformedRequest), + FailingTest(RestJsonValidation, "RestJsonMalformedLengthString_case2", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedPatternListOverride_case0", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedPatternListOverride_case1", TestType.MalformedRequest), FailingTest(RestJsonValidation, "RestJsonMalformedPatternMapKeyOverride_case0", TestType.MalformedRequest), diff --git a/codegen-test/model/rest-json-extras.smithy b/codegen-test/model/rest-json-extras.smithy index 3b85641643..508a47e57e 100644 --- a/codegen-test/model/rest-json-extras.smithy +++ b/codegen-test/model/rest-json-extras.smithy @@ -7,46 +7,6 @@ use aws.api#service use smithy.test#httpRequestTests use smithy.test#httpResponseTests -// TODO(https://github.com/awslabs/smithy/pull/1049): Remove this once the test case in Smithy is fixed -apply InputAndOutputWithHeaders @httpResponseTests([ - { - id: "FIXED_RestJsonInputAndOutputWithQuotedStringHeaders", - documentation: "Tests responses with string list header bindings that require quoting", - protocol: restJson1, - code: 200, - headers: { - "X-StringList": "\"b,c\", \"\\\"def\\\"\", a" - }, - params: { - headerStringList: ["b,c", "\"def\"", "a"] - } - } -]) - -// TODO(https://github.com/awslabs/smithy/pull/1042): Remove this once the test case in Smithy is fixed -apply PostPlayerAction @httpRequestTests([ - { - id: "FIXED_RestJsonInputUnionWithUnitMember", - documentation: "Unit types in unions are serialized like normal structures in requests.", - protocol: restJson1, - method: "POST", - "uri": "/PostPlayerInput", - body: """ - { - "action": { - "quit": {} - } - }""", - bodyMediaType: "application/json", - headers: {"Content-Type": "application/json"}, - params: { - action: { - quit: {} - } - } - } -]) - apply QueryPrecedence @httpRequestTests([ { id: "UrlParamsKeyEncoding", diff --git a/codegen/build.gradle.kts b/codegen/build.gradle.kts index 792e41d5ea..99bbcba6ac 100644 --- a/codegen/build.gradle.kts +++ b/codegen/build.gradle.kts @@ -120,9 +120,5 @@ publishing { artifact(sourcesJar) } } - repositories { - maven { - url = uri("$buildDir/repository") - } - } + repositories { maven { url = uri("$buildDir/repository") } } } diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/protocol/ProtocolTestGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/protocol/ProtocolTestGenerator.kt index 87229ebbaa..da57afdca8 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/protocol/ProtocolTestGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/protocol/ProtocolTestGenerator.kt @@ -494,13 +494,7 @@ class ProtocolTestGenerator( private val RestXml = "aws.protocoltests.restxml#RestXml" private val AwsQuery = "aws.protocoltests.query#AwsQuery" private val Ec2Query = "aws.protocoltests.ec2#AwsEc2" - private val ExpectFail = setOf( - // TODO(https://github.com/awslabs/smithy/pull/1049): Remove this once the test case in Smithy is fixed - FailingTest(RestJson, "RestJsonInputAndOutputWithQuotedStringHeaders", Action.Response), - // TODO(https://github.com/awslabs/smithy/pull/1042): Remove this once the test case in Smithy is fixed - FailingTest(RestJson, "RestJsonInputUnionWithUnitMember", Action.Request), - FailingTest("${RestJson}Extras", "RestJsonInputUnionWithUnitMember", Action.Request), - ) + private val ExpectFail = setOf() private val RunOnly: Set? = null // These tests are not even attempted to be generated, either because they will not compile diff --git a/gradle.properties b/gradle.properties index 34f9708fc0..439ca16e3a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,7 @@ smithy.rs.runtime.crate.version=0.40.2 kotlin.code.style=official # codegen -smithyVersion=1.16.1 +smithyVersion=1.21.0 # kotlin kotlinVersion=1.4.21 diff --git a/settings.gradle.kts b/settings.gradle.kts index 491acc0430..cbb4451ee1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,15 +3,6 @@ * SPDX-License-Identifier: Apache-2.0. */ -pluginManagement { - repositories { - mavenCentral() - maven("https://plugins.gradle.org/m2/") - google() - gradlePluginPortal() - } -} - rootProject.name = "software.amazon.smithy.rust.codegen.smithy-rs" enableFeaturePreview("GRADLE_METADATA")