diff --git a/CHANGELOG.md b/CHANGELOG.md index 610bfc32b..898a87d5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.18.10 + +* Bumps alloy to 0.3.1. This is required as otherwise the `alloy#nullable` hints get filtered out when using SimpleRestJsonBuilder. + # 0.18.9 * Fix bug that would lead to special characters being escaped in XML attributes, which are already quoted diff --git a/build.sbt b/build.sbt index 5239f82f7..2445b8da7 100644 --- a/build.sbt +++ b/build.sbt @@ -314,7 +314,7 @@ lazy val `aws-http4s` = projectMatrix "-Wconf:msg=value noErrorWrapping in class RestXml is deprecated:silent" ), Test / complianceTestDependencies := Seq( - Dependencies.Alloy.`protocol-tests` + Dependencies.Smithy.`aws-protocol-tests` ), (Test / resourceGenerators) := Seq(dumpModel(Test).taskValue), (Test / smithy4sModelTransformers) := Seq.empty, diff --git a/modules/aws-http4s/test/src/smithy4s/aws/compliancetests/AwsComplianceSuite.scala b/modules/aws-http4s/test/src/smithy4s/aws/compliancetests/AwsComplianceSuite.scala index 0cea7b8e6..8f32f44a7 100644 --- a/modules/aws-http4s/test/src/smithy4s/aws/compliancetests/AwsComplianceSuite.scala +++ b/modules/aws-http4s/test/src/smithy4s/aws/compliancetests/AwsComplianceSuite.scala @@ -47,7 +47,19 @@ object AwsComplianceSuite extends ProtocolComplianceSuite { "HostWithPathOperation", // We expect users to set idempotency tokens because doing so raises // awareness of the need to do so outside of any retry mechanism. - "QueryIdempotencyTokenAutoFill" + "QueryIdempotencyTokenAutoFill", + + // TODO https://github.com/disneystreaming/smithy4s/issues/1424 + "AwsJson10DeserializeIgnoreType", + "AwsJson10ClientPopulatesDefaultValuesInInput", + "AwsJson10ClientPopulatesDefaultsValuesWhenMissingInResponse", + "AwsJson10ClientPopulatesNestedDefaultValuesWhenMissing", + "AwsJson10ClientPopulatesNestedDefaultsWhenMissingInResponseBody", + "AwsJson10ClientErrorCorrectsWhenServerFailsToSerializeRequiredValues", + "AwsJson11DeserializeIgnoreType", + "RestJsonHttpPayloadWithUnsetUnion", + "RestJsonDeserializeIgnoreType", + "RestXmlHttpPayloadWithUnsetUnion" ) (complianceTest: ComplianceTest[IO]) => if (disallowed.exists(complianceTest.show.contains(_))) ShouldRun.No diff --git a/modules/codegen-plugin/src/sbt-test/codegen-plugin/defaults/build.sbt b/modules/codegen-plugin/src/sbt-test/codegen-plugin/defaults/build.sbt index 3e607fca3..15ce75672 100644 --- a/modules/codegen-plugin/src/sbt-test/codegen-plugin/defaults/build.sbt +++ b/modules/codegen-plugin/src/sbt-test/codegen-plugin/defaults/build.sbt @@ -10,7 +10,7 @@ lazy val root = (project in file(".")) val expectedLines = Set( "version", "src/main/smithy", - "com.disneystreaming.alloy:alloy-core:0.2.8" + s"com.disneystreaming.alloy:alloy-core:${smithy4s.codegen.BuildInfo.alloyVersion}" ) val content = IO.readLines(baseDirectory.value / "smithy-build.json") diff --git a/modules/codegen-plugin/src/sbt-test/codegen-plugin/multimodule/build.sbt b/modules/codegen-plugin/src/sbt-test/codegen-plugin/multimodule/build.sbt index c2c173aff..9a4f1f959 100644 --- a/modules/codegen-plugin/src/sbt-test/codegen-plugin/multimodule/build.sbt +++ b/modules/codegen-plugin/src/sbt-test/codegen-plugin/multimodule/build.sbt @@ -8,7 +8,7 @@ lazy val root = project "version", "src/main/smithy", "software.amazon.smithy:smithy-waiters:1.38.0", - "com.disneystreaming.alloy:alloy-core:0.2.8", + s"com.disneystreaming.alloy:alloy-core:${smithy4s.codegen.BuildInfo.alloyVersion}", "com.disneystreaming.smithy4s:smithy4s-protocol:", "custom", "attribute" diff --git a/modules/codegen/src/smithy4s/codegen/internals/CodegenImpl.scala b/modules/codegen/src/smithy4s/codegen/internals/CodegenImpl.scala index bda3526c2..da84ce768 100644 --- a/modules/codegen/src/smithy4s/codegen/internals/CodegenImpl.scala +++ b/modules/codegen/src/smithy4s/codegen/internals/CodegenImpl.scala @@ -26,6 +26,7 @@ import software.amazon.smithy.model.node.Node import software.amazon.smithy.model.shapes.ModelSerializer import scala.jdk.CollectionConverters._ +import software.amazon.smithy.model.transform.ModelTransformer private[codegen] object CodegenImpl { self => @@ -179,8 +180,12 @@ private[codegen] object CodegenImpl { self => discoverModels = false, args.localJars ) + val flattenedModel = + ModelTransformer.create().flattenAndRemoveMixins(model) - Node.prettyPrintJson(ModelSerializer.builder().build.serialize(model)) + Node.prettyPrintJson( + ModelSerializer.builder().build.serialize(flattenedModel) + ) } private def withAwsTypeTransformer(transformers: List[String]): List[String] = diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 7ab81642f..9064e6452 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -25,11 +25,12 @@ object Dependencies { val build = org % "smithy-build" % smithyVersion val awsTraits = org % "smithy-aws-traits" % smithyVersion val waiters = org % "smithy-waiters" % smithyVersion + val `aws-protocol-tests` = org % "smithy-aws-protocol-tests" % smithyVersion } val Alloy = new { val org = "com.disneystreaming.alloy" - val alloyVersion = "0.2.8" + val alloyVersion = "0.3.1" val core = org % "alloy-core" % alloyVersion val openapi = org %% "alloy-openapi" % alloyVersion val `protocol-tests` = org % "alloy-protocol-tests" % alloyVersion