From 6abe7b214117d98c87b64677db5e09350ffa1890 Mon Sep 17 00:00:00 2001 From: Andriy Plokhotnyuk Date: Thu, 2 Jan 2025 15:07:53 +0100 Subject: [PATCH] Update jsoniter-scala to 2.32.0 and Scala.js to 1.17.0 --- .../json/internals/SchemaVisitorJCodec.scala | 13 ++----------- project/Dependencies.scala | 2 +- project/plugins.sbt | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/modules/json/src/smithy4s/json/internals/SchemaVisitorJCodec.scala b/modules/json/src/smithy4s/json/internals/SchemaVisitorJCodec.scala index 8d0990ec5..b75179573 100644 --- a/modules/json/src/smithy4s/json/internals/SchemaVisitorJCodec.scala +++ b/modules/json/src/smithy4s/json/internals/SchemaVisitorJCodec.scala @@ -394,17 +394,8 @@ private[smithy4s] class SchemaVisitorJCodec( Timestamp(epochSeconds, ((timestamp - epochSeconds) * 1000000000).toInt) } - def encodeValue(x: Timestamp, out: JsonWriter): Unit = { - // TODO: can be improved with out.writeTimestampVal(x.epochSecond, x.nano) when https://github.com/plokhotnyuk/jsoniter-scala/releases/tag/v2.32.0 is used - out.writeVal(BigDecimal({ - val es = java.math.BigDecimal.valueOf(x.epochSecond) - if (x.nano == 0) es - else - es.add( - java.math.BigDecimal.valueOf(x.nano.toLong, 9).stripTrailingZeros - ) - })) - } + def encodeValue(x: Timestamp, out: JsonWriter): Unit = + out.writeTimestampVal(x.epochSecond, x.nano) def decodeKey(in: JsonReader): Timestamp = { val timestamp = in.readKeyAsBigDecimal() diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 5284fba62..92d797953 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -10,7 +10,7 @@ object Dependencies { val Jsoniter = new { val org = "com.github.plokhotnyuk.jsoniter-scala" - val jsoniterScalaVersion = "2.27.6" + val jsoniterScalaVersion = "2.32.0" val core = Def.setting(org %%% "jsoniter-scala-core" % jsoniterScalaVersion) val macros = Def.setting( org %%% "jsoniter-scala-macros" % jsoniterScalaVersion % "compile-internal" diff --git a/project/plugins.sbt b/project/plugins.sbt index e59cb14bf..6205c32ed 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ // format: off addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0") addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")