Add YAML support via circe-yaml
sbrunk opened this issue · 1 comments
sbrunk commented
I have some YAML that I need to load into a configuration (via ciris-kubernetes). I had a brief look into what's needed to get this working with circe-yaml.
Amazingly, all it took to get this working was to add the circe-yaml dependency, and replace the parser.
- import io.circe.parser.parse
+ import io.circe.yaml.parser.parse
It just works because the parse
method in circe-yaml
has the same signature as the circe json parser:
def parse(yaml: String): Either[ParsingFailure, Json]
So perhaps we can extend def circeConfigDecoder
to take a parser
(or delegate that to a private method) and then add a yaml module that uses the circe-yaml
parser instead of the json parser.
Happy to draft a PR if you're interested.