yaml

How to read a YAML configuration file in Scala

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 12.6, “How to read a YAML configuration file in Scala.”

Problem

You need to read a YAML configuration file in a Scala application.

Scala YAML parser examples using Snakeyaml

Summary: A Scala YAML parsing example using the Snakeyaml parser.

If you need some Scala YAML parsing examples using Snakeyaml parser, you've come to the right place. I just worked through some Snakeyaml issues related to Scala, in particular converting YAML to JavaBean classes written in Scala, so I thought I'd share the source code here.