【发布时间】:2021-03-02 01:42:09
【问题描述】:
我正在尝试从 bean 创建一个 YAML 文件。其中一个字段有 80 多个字符。当我使用 objectMapper 将 bean 写入 YAML 文件时,这些值被打印在两个不同的行中。
- code: abcd1234
label-en_US: Lorem Ipsum is simply dummied text of the printing and typesetting
industry --> this line should not be here
ObjectMapper mapper = new ObjectMapper(new YAMLFactory().enable(MINIMIZE_QUOTES));
mapper.writeValue(Paths.get("path/to/file").toFile(), getData());
【问题讨论】:
标签: java jackson jackson-databind