I am using Jackson to read and modify yaml files. It works great. I canβt find the magic spells needed to write the barley.
ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); ObjectNode root = (ObjectNode)mapper.readTree(yamlFileIn); // modify root here mapper.writeValue(yamlFileOut, root); // writes json, not yaml. not sure why.
I am sure this is a combination of writers, JsonGenerators and something else. Has anyone got sample code?
source share