It seems that the ObjectNode.PutPOJO method does not put quotes around the
members of a string array,
List<String> names = List.of("Zaphod", "Arthur", "Trillian", "Ford");
ObjectMapper objectMapper = new ObjectMapper();
ObjectNode rootNode = objectMapper.createObjectNode();
rootNode.putPOJO("pojo", names);
rootNode.set("set", objectMapper.valueToTree(names));
System.out.println(rootNode);
The above code demonstrates the issue.
The string output cannot be parsed by ObjectMapper.readTree
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.