From d42f5d199292d45e3ff8fd08a3d96c27a7a13068 Mon Sep 17 00:00:00 2001 From: Andriy Plokhotnyuk Date: Thu, 23 Jan 2025 23:14:50 +0100 Subject: [PATCH] Update zio-schema-json to 1.6.0 --- build.sbt | 2 +- .../github/plokhotnyuk/jsoniter_scala/benchmark/Main.scala | 5 ++--- .../github/plokhotnyuk/jsoniter_scala/benchmark/Main.scala | 5 ++--- .../jsoniter_scala/benchmark/NestedStructsReadingSpec.scala | 6 ++---- .../jsoniter_scala/benchmark/NestedStructsReadingSpec.scala | 6 ++---- .../jsoniter_scala/benchmark/NestedStructsReadingSpec.scala | 6 ++---- .../jsoniter_scala/benchmark/NestedStructsReadingSpec.scala | 6 ++---- .../jsoniter_scala/benchmark/NestedStructsReading.scala | 3 +-- .../jsoniter_scala/benchmark/NestedStructsReading.scala | 3 +-- 9 files changed, 15 insertions(+), 27 deletions(-) diff --git a/build.sbt b/build.sbt index b260bc1a7..66eb832f1 100644 --- a/build.sbt +++ b/build.sbt @@ -244,7 +244,7 @@ lazy val `jsoniter-scala-benchmark` = crossProject(JVMPlatform, JSPlatform) "com.evolutiongaming" %%% "play-json-jsoniter" % "0.10.3" intransitive(), "org.playframework" %%% "play-json" % "3.0.4", "dev.zio" %%% "zio-json" % "0.7.5", - "dev.zio" %%% "zio-schema-json" % "1.5.0", + "dev.zio" %%% "zio-schema-json" % "1.6.0", "io.circe" %%% "circe-generic" % "0.14.10", "io.circe" %%% "circe-jawn" % "0.14.10", "com.lihaoyi" %%% "upickle" % "4.1.0", diff --git a/jsoniter-scala-benchmark/js/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/Main.scala b/jsoniter-scala-benchmark/js/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/Main.scala index 238a3fbbc..e4945e425 100644 --- a/jsoniter-scala-benchmark/js/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/Main.scala +++ b/jsoniter-scala-benchmark/js/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/Main.scala @@ -1420,9 +1420,8 @@ object Main { B("playJsonJsoniter")(benchmark.playJsonJsoniter()), B("smithy4sJson")(benchmark.smithy4sJson()), B("uPickle")(benchmark.uPickle()), - B("zioJson")(benchmark.zioJson()) - //FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 - //B("zioSchemaJson")(benchmark.zioSchemaJson()) + B("zioJson")(benchmark.zioJson()), + B("zioSchemaJson")(benchmark.zioSchemaJson()) )) }, { val benchmark = new NestedStructsWriting { size = 128; setup() } diff --git a/jsoniter-scala-benchmark/js/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/Main.scala b/jsoniter-scala-benchmark/js/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/Main.scala index c2ebb4bb8..0059f4e85 100644 --- a/jsoniter-scala-benchmark/js/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/Main.scala +++ b/jsoniter-scala-benchmark/js/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/Main.scala @@ -1319,9 +1319,8 @@ object Main { B("playJsonJsoniter")(benchmark.playJsonJsoniter()), B("smithy4sJson")(benchmark.smithy4sJson()), B("uPickle")(benchmark.uPickle()), - B("zioJson")(benchmark.zioJson()) - //FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 - //B("zioSchemaJson")(benchmark.zioSchemaJson()) + B("zioJson")(benchmark.zioJson()), + B("zioSchemaJson")(benchmark.zioSchemaJson()) )) }, { val benchmark = new NestedStructsWriting { size = 128; setup() } diff --git a/jsoniter-scala-benchmark/js/src/test/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala b/jsoniter-scala-benchmark/js/src/test/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala index c0ee4438d..ba0846ce8 100644 --- a/jsoniter-scala-benchmark/js/src/test/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala +++ b/jsoniter-scala-benchmark/js/src/test/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala @@ -20,8 +20,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase { benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj benchmark.zioJson() shouldBe benchmark.obj - //FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 - //benchmark.zioSchemaJson() shouldBe benchmark.obj + benchmark.zioSchemaJson() shouldBe benchmark.obj } "fail on invalid input" in { val b = benchmark @@ -35,8 +34,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.uPickle()) intercept[Throwable](b.zioJson()) - //FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 - //intercept[Throwable](b.zioJson()) + intercept[Throwable](b.zioSchemaJson()) } } } \ No newline at end of file diff --git a/jsoniter-scala-benchmark/js/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala b/jsoniter-scala-benchmark/js/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala index cefbdc806..3a8099076 100644 --- a/jsoniter-scala-benchmark/js/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala +++ b/jsoniter-scala-benchmark/js/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala @@ -19,8 +19,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase { benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj benchmark.zioJson() shouldBe benchmark.obj - //FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 - //benchmark.zioSchemaJson() shouldBe benchmark.obj + benchmark.zioSchemaJson() shouldBe benchmark.obj } "fail on invalid input" in { val b = benchmark @@ -33,8 +32,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.uPickle()) intercept[Throwable](b.zioJson()) - //FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 - //intercept[Throwable](b.zioSchemaJson()) + intercept[Throwable](b.zioSchemaJson()) } } } \ No newline at end of file diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala index 127f5247b..d6a152b5e 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala @@ -26,8 +26,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase { benchmark.uPickle() shouldBe benchmark.obj benchmark.weePickle() shouldBe benchmark.obj benchmark.zioJson() shouldBe benchmark.obj - //FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 - //benchmark.zioSchemaJson() shouldBe benchmark.obj + benchmark.zioSchemaJson() shouldBe benchmark.obj } "fail on invalid input" in { val b = benchmark @@ -48,8 +47,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.uPickle()) intercept[Throwable](b.weePickle()) intercept[Throwable](b.zioJson()) - //FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 - //intercept[Throwable](b.zioSchemaJson()) + intercept[Throwable](b.zioSchemaJson()) } } } \ No newline at end of file diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala index d244498e9..30e7b316d 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala @@ -24,8 +24,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase { benchmark.uPickle() shouldBe benchmark.obj benchmark.weePickle() shouldBe benchmark.obj benchmark.zioJson() shouldBe benchmark.obj - //FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 - //benchmark.zioSchemaJson() shouldBe benchmark.obj + benchmark.zioSchemaJson() shouldBe benchmark.obj } "fail on invalid input" in { val b = benchmark @@ -44,8 +43,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.uPickle()) intercept[Throwable](b.weePickle()) intercept[Throwable](b.zioJson()) - //FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 - //intercept[Throwable](b.zioSchemaJson()) + intercept[Throwable](b.zioSchemaJson()) } } } \ No newline at end of file diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReading.scala index 2c6dc6726..6df263a47 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReading.scala @@ -134,7 +134,7 @@ class NestedStructsReading extends NestedStructsBenchmark { new String(jsonBytes, UTF_8).fromJson[NestedStructs].fold(sys.error, identity) } -/* FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 + @Benchmark def zioSchemaJson(): NestedStructs = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.ZioSchemaJsonCodecs._ @@ -142,5 +142,4 @@ class NestedStructsReading extends NestedStructsBenchmark { nestedStructsCodec.decodeJson(new String(jsonBytes, UTF_8)).fold(sys.error, identity) } -*/ } \ No newline at end of file diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReading.scala index ceb596570..965819db9 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReading.scala @@ -121,7 +121,7 @@ class NestedStructsReading extends NestedStructsBenchmark { new String(jsonBytes, UTF_8).fromJson[NestedStructs].fold(sys.error, identity) } -/* FIXME: zio-schema-json parses only 127 levels of nesting instead of 128 + @Benchmark def zioSchemaJson(): NestedStructs = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.ZioSchemaJsonCodecs._ @@ -129,5 +129,4 @@ class NestedStructsReading extends NestedStructsBenchmark { nestedStructsCodec.decodeJson(new String(jsonBytes, UTF_8)).fold(sys.error, identity) } -*/ } \ No newline at end of file