Loading CHANGELOG.next.toml +7 −1 Original line number Diff line number Diff line Loading @@ -10,3 +10,9 @@ # references = ["smithy-rs#920"] # meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"} # author = "rcoh" [[aws-sdk-rust]] message = "Fix broken serialization for SQS" references = ["smithy-rs#3210", "aws-sdk-rust#957"] meta = { "breaking" = false, "tada" = false, "bug" = false } author = "rcoh" buildSrc/src/main/kotlin/CodegenTestCommon.kt +11 −6 Original line number Diff line number Diff line Loading @@ -90,9 +90,11 @@ private fun codegenTests(properties: PropertyRetriever, allTests: List<CodegenTe allTests } require(ret.isNotEmpty()) { "None of the provided module overrides (`$modulesOverride`) are valid test services (`${allTests.map { "None of the provided module overrides (`$modulesOverride`) are valid test services (`${ allTests.map { it.module }}`)" } }`)" } return ret } Loading Loading @@ -121,9 +123,11 @@ fun cargoCommands(properties: PropertyRetriever): List<Cargo> { AllCargoCommands } require(ret.isNotEmpty()) { "None of the provided cargo commands (`$cargoCommandsOverride`) are valid cargo commands (`${AllCargoCommands.map { "None of the provided cargo commands (`$cargoCommandsOverride`) are valid cargo commands (`${ AllCargoCommands.map { it.toString }}`)" } }`)" } return ret } Loading @@ -137,6 +141,7 @@ fun Project.registerGenerateSmithyBuildTask( this.tasks.register("generateSmithyBuild") { description = "generate smithy-build.json" outputs.file(project.projectDir.resolve("smithy-build.json")) // NOTE: This is not working. allCodegenTests.flatMap { it.imports }.forEach { inputs.file(project.projectDir.resolve(it)) } doFirst { Loading codegen-client-test/build.gradle.kts +8 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,11 @@ val allCodegenTests = listOf( ClientTest("aws.protocoltests.restxml#RestXml", "rest_xml", addMessageToErrors = false), ClientTest("aws.protocoltests.query#AwsQuery", "aws_query", addMessageToErrors = false), ClientTest("aws.protocoltests.ec2#AwsEc2", "ec2_query", addMessageToErrors = false), ClientTest("aws.protocoltests.restxml.xmlns#RestXmlWithNamespace", "rest_xml_namespace", addMessageToErrors = false), ClientTest( "aws.protocoltests.restxml.xmlns#RestXmlWithNamespace", "rest_xml_namespace", addMessageToErrors = false, ), ClientTest("aws.protocoltests.restxml#RestXmlExtras", "rest_xml_extras", addMessageToErrors = false), ClientTest( "aws.protocoltests.restxmlunwrapped#RestXmlExtrasUnwrappedErrors", Loading Loading @@ -108,7 +112,10 @@ val allCodegenTests = listOf( "pokemon-service-awsjson-client", dependsOn = listOf("pokemon-awsjson.smithy", "pokemon-common.smithy"), ), ClientTest("aws.protocoltests.misc#QueryCompatService", "query-compat-test", dependsOn = listOf("aws-json-query-compat.smithy")), ).map(ClientTest::toCodegenTest) // use this line to run just one test // .filter { it.module == "query-compat-test" } project.registerGenerateSmithyBuildTask(rootProject, pluginName, allCodegenTests) project.registerGenerateCargoWorkspaceTask(rootProject, pluginName, allCodegenTests, workingDirUnderBuildDir) Loading codegen-core/common-test-models/aws-json-query-compat.smithy 0 → 100644 +38 −0 Original line number Diff line number Diff line $version: "1.0" namespace aws.protocoltests.misc use aws.protocols#awsQueryCompatible use aws.protocols#awsJson1_0 use aws.protocols#awsQueryError use smithy.test#httpRequestTests @awsQueryCompatible @awsJson1_0 service QueryCompatService { operations: [ Operation ] } @httpRequestTests([{ id: "BasicQueryCompatTest" protocol: awsJson1_0, method: "POST", uri: "https://foo.com", body: "{\"message\":\"hello!\"}", bodyMedaType: "application/json", params: { message: "hello!" }, headers: { "x-amz-target": "QueryCompatService.Operation"} } ]) operation Operation { input: OperationInputOutput output: OperationInputOutput } structure OperationInputOutput { message: String } codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsQueryCompatible.kt +3 −0 Original line number Diff line number Diff line Loading @@ -92,4 +92,7 @@ class AwsQueryCompatible( override fun parseEventStreamErrorMetadata(operationShape: OperationShape): RuntimeType = awsJson.parseEventStreamErrorMetadata(operationShape) override fun additionalRequestHeaders(operationShape: OperationShape): List<Pair<String, String>> = listOf("x-amz-target" to "${codegenContext.serviceShape.id.name}.${operationShape.id.name}") } Loading
CHANGELOG.next.toml +7 −1 Original line number Diff line number Diff line Loading @@ -10,3 +10,9 @@ # references = ["smithy-rs#920"] # meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"} # author = "rcoh" [[aws-sdk-rust]] message = "Fix broken serialization for SQS" references = ["smithy-rs#3210", "aws-sdk-rust#957"] meta = { "breaking" = false, "tada" = false, "bug" = false } author = "rcoh"
buildSrc/src/main/kotlin/CodegenTestCommon.kt +11 −6 Original line number Diff line number Diff line Loading @@ -90,9 +90,11 @@ private fun codegenTests(properties: PropertyRetriever, allTests: List<CodegenTe allTests } require(ret.isNotEmpty()) { "None of the provided module overrides (`$modulesOverride`) are valid test services (`${allTests.map { "None of the provided module overrides (`$modulesOverride`) are valid test services (`${ allTests.map { it.module }}`)" } }`)" } return ret } Loading Loading @@ -121,9 +123,11 @@ fun cargoCommands(properties: PropertyRetriever): List<Cargo> { AllCargoCommands } require(ret.isNotEmpty()) { "None of the provided cargo commands (`$cargoCommandsOverride`) are valid cargo commands (`${AllCargoCommands.map { "None of the provided cargo commands (`$cargoCommandsOverride`) are valid cargo commands (`${ AllCargoCommands.map { it.toString }}`)" } }`)" } return ret } Loading @@ -137,6 +141,7 @@ fun Project.registerGenerateSmithyBuildTask( this.tasks.register("generateSmithyBuild") { description = "generate smithy-build.json" outputs.file(project.projectDir.resolve("smithy-build.json")) // NOTE: This is not working. allCodegenTests.flatMap { it.imports }.forEach { inputs.file(project.projectDir.resolve(it)) } doFirst { Loading
codegen-client-test/build.gradle.kts +8 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,11 @@ val allCodegenTests = listOf( ClientTest("aws.protocoltests.restxml#RestXml", "rest_xml", addMessageToErrors = false), ClientTest("aws.protocoltests.query#AwsQuery", "aws_query", addMessageToErrors = false), ClientTest("aws.protocoltests.ec2#AwsEc2", "ec2_query", addMessageToErrors = false), ClientTest("aws.protocoltests.restxml.xmlns#RestXmlWithNamespace", "rest_xml_namespace", addMessageToErrors = false), ClientTest( "aws.protocoltests.restxml.xmlns#RestXmlWithNamespace", "rest_xml_namespace", addMessageToErrors = false, ), ClientTest("aws.protocoltests.restxml#RestXmlExtras", "rest_xml_extras", addMessageToErrors = false), ClientTest( "aws.protocoltests.restxmlunwrapped#RestXmlExtrasUnwrappedErrors", Loading Loading @@ -108,7 +112,10 @@ val allCodegenTests = listOf( "pokemon-service-awsjson-client", dependsOn = listOf("pokemon-awsjson.smithy", "pokemon-common.smithy"), ), ClientTest("aws.protocoltests.misc#QueryCompatService", "query-compat-test", dependsOn = listOf("aws-json-query-compat.smithy")), ).map(ClientTest::toCodegenTest) // use this line to run just one test // .filter { it.module == "query-compat-test" } project.registerGenerateSmithyBuildTask(rootProject, pluginName, allCodegenTests) project.registerGenerateCargoWorkspaceTask(rootProject, pluginName, allCodegenTests, workingDirUnderBuildDir) Loading
codegen-core/common-test-models/aws-json-query-compat.smithy 0 → 100644 +38 −0 Original line number Diff line number Diff line $version: "1.0" namespace aws.protocoltests.misc use aws.protocols#awsQueryCompatible use aws.protocols#awsJson1_0 use aws.protocols#awsQueryError use smithy.test#httpRequestTests @awsQueryCompatible @awsJson1_0 service QueryCompatService { operations: [ Operation ] } @httpRequestTests([{ id: "BasicQueryCompatTest" protocol: awsJson1_0, method: "POST", uri: "https://foo.com", body: "{\"message\":\"hello!\"}", bodyMedaType: "application/json", params: { message: "hello!" }, headers: { "x-amz-target": "QueryCompatService.Operation"} } ]) operation Operation { input: OperationInputOutput output: OperationInputOutput } structure OperationInputOutput { message: String }
codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/protocols/AwsQueryCompatible.kt +3 −0 Original line number Diff line number Diff line Loading @@ -92,4 +92,7 @@ class AwsQueryCompatible( override fun parseEventStreamErrorMetadata(operationShape: OperationShape): RuntimeType = awsJson.parseEventStreamErrorMetadata(operationShape) override fun additionalRequestHeaders(operationShape: OperationShape): List<Pair<String, String>> = listOf("x-amz-target" to "${codegenContext.serviceShape.id.name}.${operationShape.id.name}") }