Replies: 1 comment 1 reply
-
Hey @colin4124! There is no codec/encoder derivation for Scala 2 so you can only convert Strings to YAML AST. However, there is an integration with circe created by @armanbilge - https://github.com/armanbilge/circe-scala-yaml. Below I pasted scala-cli snippet with some usage of them both. //> using scala "2.13.10"
//> using lib "org.virtuslab::scala-yaml::0.0.6"
//> using lib "com.armanbilge::circe-scala-yaml::0.0.4"
import org.virtuslab.yaml._
import io.circe.scalayaml._
object Yaml extends App {
val myYaml = """foo: bar"""
println(parser.parse(myYaml))
println()
println(myYaml.asNode)
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Document's example is all about scala 3, how about scala2 ?
Beta Was this translation helpful? Give feedback.
All reactions