Skip to content

Commit

Permalink
Merge pull request #1423 from disneystreaming/bump-alloy-to-0.3.1
Browse files Browse the repository at this point in the history
Update alloy to 0.3.1
  • Loading branch information
Baccata committed Feb 28, 2024
2 parents 4c74fa7 + 4509593 commit 8cb01fd
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 6 deletions.
4 changes: 4 additions & 0 deletions 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
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Expand Up @@ -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,
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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")
Expand Down
Expand Up @@ -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"
Expand Down
Expand Up @@ -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 =>

Expand Down Expand Up @@ -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] =
Expand Down
3 changes: 2 additions & 1 deletion project/Dependencies.scala
Expand Up @@ -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
Expand Down

0 comments on commit 8cb01fd

Please sign in to comment.