config
config copied to clipboard
Yaml support
I think the API of this is elegant and confort to use, but my job needs me to use yaml files, is there any way to parse yaml to a com.typesafe.config.Config?
Yaml libraries are just as large as this library so we don't depend on one. One approach could be to parse the yaml with a yaml lib then render it as json then parse the json with this lib. Not efficient but possibly very easy to implement and for a one time startup cost probably inefficient is fine.
There was also an issue with some discussion of allowing a yaml plugin to be dropped in, iirc, but don't think anyone has seriously worked on it.
I'm also interested on YAML support since it's much nicer for configuration than a JSON file. I understand that doubling the size because of the YAML parsers is not a good thing and this framework should remain as lightweight as possible.
On option is to make the dependency to the YAML parser optional so only those that want to use YAML will suffer the addition of the YAML library.
I think some kind of “SPI” approach where the yaml parser can be dropped on the classpath could be worth exploring
I have YAML working locally for the most part. I was hoping an SPI approach would come up because being limited by the ConfigSyntax enum was driving me nuts.
Has anyone considered a two-step process? I am interested in exchanging notes.
- Outside of Lightbend Config, convert YAML to JSON - https://stackoverflow.com/questions/23744216/how-do-i-convert-from-yaml-to-json-in-java
- Load generated JSON into Lightbend Config