アレックス アレックス - 16 days ago 10
YAML Question

Working with YAML for Scala

I found one library for this https://github.com/daltontf/scala-yaml, but it seems like not many developers use it and it's pretty outdated. It also might be this http://www.lag.net/configgy/ if the link wasn't dead.

I wonder, what is the most popular or de-facto library for working with YAML in Scala?

Answer

SnakeYAML is a high-quality, actively maintained YAML parser/renderer for Java. You can of course use it from Scala.

HelicalYAML provides a Scala wrapper for SnakeYAML if you really want that convenience, but I can't attest to the quality or longevity of the project.

I would love to see a library that could parse either JSON or YAML (or whatever -- pluggable) to a common AST and then construct Scala objects using typeclasses. Several JSON libraries work like that (and of course can also render JSON for objects using the same typeclasses), but I don't know of such a facility for YAML.

Comments