Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update alloy to 0.3.1 #1423

Merged
merged 5 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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