Skip to content

Commit

Permalink
Bump aws smithy version to 1.45.0 (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-vila authored Feb 27, 2024
1 parent fc26f60 commit 9f2dbcb
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
|}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ object ErrorMessageTraitValidatorSpec extends FunSuite {
.assemble()

val expected = List(
noErrorTrait(union),
ValidationEvent
.builder()
.id("TraitTarget")
Expand All @@ -170,6 +169,6 @@ object ErrorMessageTraitValidatorSpec extends FunSuite {
)
.build()
)
expect(model.getValidationEvents().asScala.toList == expected)
expect.same(model.getValidationEvents().asScala.toList, expected)
}
}
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f2dbcb

Please sign in to comment.