Closed mike03081972 closed 6 years ago
Hi,
If I use YAMLFactory instead of default JSON factory, my custom indentation is not taken into account.
Any idea ?
DefaultPrettyPrinter.Indenter indenter = new DefaultIndenter(" ", DefaultIndenter.SYS_LF); DefaultPrettyPrinter printer = new DefaultPrettyPrinter(); printer.indentObjectsWith(indenter); printer.indentArraysWith(indenter); ObjectMapper objectMapper = new ObjectMapper( new YAMLFactory() ); objectMapper.setDefaultPrettyPrinter(printer); objectMapper.enable(SerializationFeature.INDENT_OUTPUT); String yaml= objectMapper.writeValueAsString(myObject);
I think you have posted this into the wrong repository. This is the Swift version of ObjectMapper for iOS and macOS. It does not support custom JSON factories at this time.
Hi,
If I use YAMLFactory instead of default JSON factory, my custom indentation is not taken into account.
Any idea ?