From 13fa6d9ea6672ed0bd3072c25d1d9cdb47f144b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Membr=C3=A9?= Date: Mon, 3 Jul 2023 09:27:32 +0200 Subject: [PATCH] Update snakeyaml dependency to 2.0 (#974) * Update snakeyaml dependency to 2.0 * Remove unused import --- build.sbt | 2 +- .../scala/zio/json/yaml/internal/YamlValueConstruction.scala | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 9b737a179..03f72d697 100644 --- a/build.sbt +++ b/build.sbt @@ -248,7 +248,7 @@ lazy val zioJsonYaml = project .settings(buildInfoSettings("zio.json.yaml")) .settings( libraryDependencies ++= Seq( - "org.yaml" % "snakeyaml" % "1.33", + "org.yaml" % "snakeyaml" % "2.0", "dev.zio" %% "zio" % zioVersion, "dev.zio" %% "zio-test" % zioVersion % "test", "dev.zio" %% "zio-test-sbt" % zioVersion % "test" diff --git a/zio-json-yaml/src/main/scala/zio/json/yaml/internal/YamlValueConstruction.scala b/zio-json-yaml/src/main/scala/zio/json/yaml/internal/YamlValueConstruction.scala index 46aab20f2..af34ded1a 100644 --- a/zio-json-yaml/src/main/scala/zio/json/yaml/internal/YamlValueConstruction.scala +++ b/zio-json-yaml/src/main/scala/zio/json/yaml/internal/YamlValueConstruction.scala @@ -2,10 +2,9 @@ package zio.json.yaml.internal import org.yaml.snakeyaml.constructor.SafeConstructor import org.yaml.snakeyaml.nodes.{ MappingNode, Node } -import scala.annotation.nowarn +import org.yaml.snakeyaml.LoaderOptions -@nowarn -private[yaml] final class YamlValueConstruction extends SafeConstructor { +private[yaml] final class YamlValueConstruction extends SafeConstructor(new LoaderOptions()) { def toJavaValue(node: Node): AnyRef = getConstructor(node).construct(node)