From 9f2dbcbd29b4dbd35792fa40e423a6395ae3f9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Vil=C3=A1?= Date: Tue, 27 Feb 2024 14:04:25 +0000 Subject: [PATCH] Bump aws smithy version to 1.45.0 (#1419) --- .../amazonaws/dynamodb/ListTablesInputLimit.scala | 4 +--- .../generated/smithy4s/example/DefaultTest.scala | 14 +++++++------- .../generated/smithy4s/example/ObjectSize.scala | 4 +--- .../generated/smithy4s/example/OrderNumber.scala | 4 +--- .../smithy4s/example/PatchableEdgeCases.scala | 4 ++-- .../smithy4s/codegen/internals/SmithyToIR.scala | 4 ++++ .../transformers/AwsConstraintsRemoverSpec.scala | 4 +--- .../ErrorMessageTraitValidatorSpec.scala | 3 +-- project/Dependencies.scala | 2 +- 9 files changed, 19 insertions(+), 24 deletions(-) diff --git a/modules/bootstrapped/src/generated/com/amazonaws/dynamodb/ListTablesInputLimit.scala b/modules/bootstrapped/src/generated/com/amazonaws/dynamodb/ListTablesInputLimit.scala index 40e5e5e62..342776354 100644 --- a/modules/bootstrapped/src/generated/com/amazonaws/dynamodb/ListTablesInputLimit.scala +++ b/modules/bootstrapped/src/generated/com/amazonaws/dynamodb/ListTablesInputLimit.scala @@ -9,9 +9,7 @@ import smithy4s.schema.Schema.int object ListTablesInputLimit extends Newtype[Int] { val id: ShapeId = ShapeId("com.amazonaws.dynamodb", "ListTablesInputLimit") - val hints: Hints = Hints( - smithy.api.Box(), - ).lazily + val hints: Hints = Hints.empty val underlyingSchema: Schema[Int] = int.withId(id).addHints(hints).validated(smithy.api.Range(min = Some(scala.math.BigDecimal(1.0)), max = Some(scala.math.BigDecimal(100.0)))) implicit val schema: Schema[ListTablesInputLimit] = bijection(underlyingSchema, asBijection) } diff --git a/modules/bootstrapped/src/generated/smithy4s/example/DefaultTest.scala b/modules/bootstrapped/src/generated/smithy4s/example/DefaultTest.scala index ab84aae79..2413dfa7f 100644 --- a/modules/bootstrapped/src/generated/smithy4s/example/DefaultTest.scala +++ b/modules/bootstrapped/src/generated/smithy4s/example/DefaultTest.scala @@ -33,19 +33,19 @@ object DefaultTest extends ShapeTag.Companion[DefaultTest] { StringList.underlyingSchema.field[DefaultTest]("three", _.three).addHints(smithy.api.Default(smithy4s.Document.array())), StringList.underlyingSchema.field[DefaultTest]("four", _.four).addHints(smithy.api.Default(smithy4s.Document.array())), string.field[DefaultTest]("five", _.five).addHints(smithy.api.Default(smithy4s.Document.fromString(""))), - int.field[DefaultTest]("six", _.six).addHints(smithy.api.Box(), smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), + int.field[DefaultTest]("six", _.six).addHints(smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), document.field[DefaultTest]("seven", _.seven).addHints(smithy.api.Default(smithy4s.Document.nullDoc)), DefaultStringMap.underlyingSchema.field[DefaultTest]("eight", _.eight).addHints(smithy.api.Default(smithy4s.Document.obj())), - short.field[DefaultTest]("nine", _.nine).addHints(smithy.api.Box(), smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), - double.field[DefaultTest]("ten", _.ten).addHints(smithy.api.Box(), smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), - float.field[DefaultTest]("eleven", _.eleven).addHints(smithy.api.Box(), smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), - long.field[DefaultTest]("twelve", _.twelve).addHints(smithy.api.Box(), smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), + short.field[DefaultTest]("nine", _.nine).addHints(smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), + double.field[DefaultTest]("ten", _.ten).addHints(smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), + float.field[DefaultTest]("eleven", _.eleven).addHints(smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), + long.field[DefaultTest]("twelve", _.twelve).addHints(smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), timestamp.field[DefaultTest]("thirteen", _.thirteen).addHints(smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), timestamp.field[DefaultTest]("fourteen", _.fourteen).addHints(smithy.api.TimestampFormat.HTTP_DATE.widen, smithy.api.Default(smithy4s.Document.fromString("Thu, 01 Jan 1970 00:00:00 GMT"))), timestamp.field[DefaultTest]("fifteen", _.fifteen).addHints(smithy.api.TimestampFormat.DATE_TIME.widen, smithy.api.Default(smithy4s.Document.fromString("1970-01-01T00:00:00.00Z"))), - byte.field[DefaultTest]("sixteen", _.sixteen).addHints(smithy.api.Box(), smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), + byte.field[DefaultTest]("sixteen", _.sixteen).addHints(smithy.api.Default(smithy4s.Document.fromDouble(0.0d))), bytes.field[DefaultTest]("seventeen", _.seventeen).addHints(smithy.api.Default(smithy4s.Document.array())), - boolean.field[DefaultTest]("eighteen", _.eighteen).addHints(smithy.api.Box(), smithy.api.Default(smithy4s.Document.fromBoolean(false))), + boolean.field[DefaultTest]("eighteen", _.eighteen).addHints(smithy.api.Default(smithy4s.Document.fromBoolean(false))), ){ DefaultTest.apply }.withId(id).addHints(hints) diff --git a/modules/bootstrapped/src/generated/smithy4s/example/ObjectSize.scala b/modules/bootstrapped/src/generated/smithy4s/example/ObjectSize.scala index b3916eb16..3f59d601e 100644 --- a/modules/bootstrapped/src/generated/smithy4s/example/ObjectSize.scala +++ b/modules/bootstrapped/src/generated/smithy4s/example/ObjectSize.scala @@ -9,9 +9,7 @@ import smithy4s.schema.Schema.int object ObjectSize extends Newtype[Int] { val id: ShapeId = ShapeId("smithy4s.example", "ObjectSize") - val hints: Hints = Hints( - smithy.api.Box(), - ).lazily + val hints: Hints = Hints.empty val underlyingSchema: Schema[Int] = int.withId(id).addHints(hints) implicit val schema: Schema[ObjectSize] = bijection(underlyingSchema, asBijection) } diff --git a/modules/bootstrapped/src/generated/smithy4s/example/OrderNumber.scala b/modules/bootstrapped/src/generated/smithy4s/example/OrderNumber.scala index dc62ab4f8..3211cc29c 100644 --- a/modules/bootstrapped/src/generated/smithy4s/example/OrderNumber.scala +++ b/modules/bootstrapped/src/generated/smithy4s/example/OrderNumber.scala @@ -9,9 +9,7 @@ import smithy4s.schema.Schema.int object OrderNumber extends Newtype[Int] { val id: ShapeId = ShapeId("smithy4s.example", "OrderNumber") - val hints: Hints = Hints( - smithy.api.Box(), - ).lazily + val hints: Hints = Hints.empty val underlyingSchema: Schema[Int] = int.withId(id).addHints(hints) implicit val schema: Schema[OrderNumber] = bijection(underlyingSchema, asBijection) } diff --git a/modules/bootstrapped/src/generated/smithy4s/example/PatchableEdgeCases.scala b/modules/bootstrapped/src/generated/smithy4s/example/PatchableEdgeCases.scala index 6e49b6ae7..d2681ab34 100644 --- a/modules/bootstrapped/src/generated/smithy4s/example/PatchableEdgeCases.scala +++ b/modules/bootstrapped/src/generated/smithy4s/example/PatchableEdgeCases.scala @@ -19,9 +19,9 @@ object PatchableEdgeCases extends ShapeTag.Companion[PatchableEdgeCases] { implicit val schema: Schema[PatchableEdgeCases] = struct( int.nullable.required[PatchableEdgeCases]("required", _.required), int.nullable.required[PatchableEdgeCases]("requiredDefaultValue", _.requiredDefaultValue).addHints(smithy.api.Default(smithy4s.Document.fromDouble(3.0d))), - int.nullable.required[PatchableEdgeCases]("requiredDefaultNull", _.requiredDefaultNull).addHints(smithy.api.Box(), smithy.api.Default(smithy4s.Document.nullDoc)), + int.nullable.required[PatchableEdgeCases]("requiredDefaultNull", _.requiredDefaultNull).addHints(smithy.api.Default(smithy4s.Document.nullDoc)), int.nullable.field[PatchableEdgeCases]("defaultValue", _.defaultValue).addHints(smithy.api.Default(smithy4s.Document.fromDouble(5.0d))), - int.nullable.field[PatchableEdgeCases]("defaultNull", _.defaultNull).addHints(smithy.api.Box(), smithy.api.Default(smithy4s.Document.nullDoc)), + int.nullable.field[PatchableEdgeCases]("defaultNull", _.defaultNull).addHints(smithy.api.Default(smithy4s.Document.nullDoc)), ){ PatchableEdgeCases.apply }.withId(id).addHints(hints) diff --git a/modules/codegen/src/smithy4s/codegen/internals/SmithyToIR.scala b/modules/codegen/src/smithy4s/codegen/internals/SmithyToIR.scala index 5f8e43263..f3954b136 100644 --- a/modules/codegen/src/smithy4s/codegen/internals/SmithyToIR.scala +++ b/modules/codegen/src/smithy4s/codegen/internals/SmithyToIR.scala @@ -986,6 +986,10 @@ private[codegen] class SmithyToIR(model: Model, namespace: String) { .filterNot(_.toShapeId().getNamespace() == "smithy.synthetic") // enumValue can be derived from enum schemas anyway, so we're removing it from hints .filterNot(_.toShapeId() == EnumValueTrait.ID) + // remove box trait + .filterNot(_.toShapeId() == BoxTrait.ID): @nowarn( + "msg=class BoxTrait in package traits is deprecated" + ) val nonConstraintNonMetaTraits = nonMetaTraits.collect { case t if ConstraintTrait.unapply(t).isEmpty => t diff --git a/modules/codegen/test/src/smithy4s/codegen/transformers/AwsConstraintsRemoverSpec.scala b/modules/codegen/test/src/smithy4s/codegen/transformers/AwsConstraintsRemoverSpec.scala index 75b2f6d9a..32d24c6fd 100644 --- a/modules/codegen/test/src/smithy4s/codegen/transformers/AwsConstraintsRemoverSpec.scala +++ b/modules/codegen/test/src/smithy4s/codegen/transformers/AwsConstraintsRemoverSpec.scala @@ -103,9 +103,7 @@ final class AwsConstraintsRemoverSpec extends munit.FunSuite { | |object Long extends Newtype[scala.Long] { | val id: ShapeId = ShapeId("com.amazonaws.dummy", "Long") - | val hints: Hints = Hints( - | smithy.api.Box(), - | ).lazily + | val hints: Hints = Hints.empty | val underlyingSchema: Schema[scala.Long] = long.withId(id).addHints(hints) | implicit val schema: Schema[Long] = bijection(underlyingSchema, asBijection) |} diff --git a/modules/protocol-tests/test/src/smithy4s/api/validation/ErrorMessageTraitValidatorSpec.scala b/modules/protocol-tests/test/src/smithy4s/api/validation/ErrorMessageTraitValidatorSpec.scala index 61c2f5903..46028dcdd 100644 --- a/modules/protocol-tests/test/src/smithy4s/api/validation/ErrorMessageTraitValidatorSpec.scala +++ b/modules/protocol-tests/test/src/smithy4s/api/validation/ErrorMessageTraitValidatorSpec.scala @@ -159,7 +159,6 @@ object ErrorMessageTraitValidatorSpec extends FunSuite { .assemble() val expected = List( - noErrorTrait(union), ValidationEvent .builder() .id("TraitTarget") @@ -170,6 +169,6 @@ object ErrorMessageTraitValidatorSpec extends FunSuite { ) .build() ) - expect(model.getValidationEvents().asScala.toList == expected) + expect.same(model.getValidationEvents().asScala.toList, expected) } } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 60fea777b..7ab81642f 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -19,7 +19,7 @@ object Dependencies { val Smithy = new { val org = "software.amazon.smithy" - val smithyVersion = "1.41.1" + val smithyVersion = "1.45.0" val model = org % "smithy-model" % smithyVersion val testTraits = org % "smithy-protocol-test-traits" % smithyVersion val build = org % "smithy-build" % smithyVersion