Skip to content

Tag: yaml

Missing double quotes for the required field using Snake Yaml

i am trying to read a Yaml template and replace certain fields in the template dynamically and create a new Yaml file. My resultant yaml file should reflect the template in all aspects including the double quotes. But I am missing double quotes for the required fields when I use snake yaml. Can anyone please …

Parse list of beans with snakeyaml

Is it possible to parse with snakeyaml the following content and obtain a List<Radio> (where Radio is the appropriate java bean) ? new Yaml().load(…); returns a List<HashMap>, but I’d like to get a List<Radio> instead. Answer The only way I know is to use a top object to handle t…

How do I stop jackson’s YAML writer from quoting values

I’m working on a project to convert files from JSON to YAML. I’m using the 2.8.3 versions of the following libraries: jackson-core jackson-databind jackson-dataformat-yaml jackson-annotations My YAML serialization code is extremely simple: The YAML produced by this code looks like the following: A…

How do I convert from YAML to JSON in Java?

I just want to convert a string that contains a yaml into another string that contains the corrseponding converted json using Java. For example supose that I have the content of this yaml in a String called yamlDoc: I want some method that can convert the yaml String into another String with the corresponding…