-
-
Notifications
You must be signed in to change notification settings - Fork 151
Closed
Labels
yamlIssue related to YAML format backendIssue related to YAML format backend
Milestone
Description
YAMLGenerator does not quote empty strings if MINIMIZE_QUOTES is enabled.
The YAML 1.2 spec says that plain (unquoted) scalars cannot be empty i.e. an empty string must always be quoted.
YAMLFactory f = new YAMLFactory();
f.configure(YAMLGenerator.Feature.MINIMIZE_QUOTES, true);
YAMLMapper mapper = new YAMLMapper(f);
Map<String, Object> content = new HashMap<>();
content.put("key", "");
String yaml = mapper.writeValueAsString(content).trim();
assertEquals("---\nkey: \"\"", yaml); // fails - actual output is "---\nkey:"
JohannesRudolph
Metadata
Metadata
Assignees
Labels
yamlIssue related to YAML format backendIssue related to YAML format backend