Make JsonNode.toString()
use shared ObjectMapper
to produce valid json
#2187
Milestone
JsonNode.toString()
use shared ObjectMapper
to produce valid json
#2187
Jackson 2.x has half-assed implementation of
JsonNode.toString()
which sort-of, mostly works, but:JsonGenerator
, so it is implemented with a simple, non-complete, code-duplicating writersAt first the plan was to actually make
toString()
produce visibly non-JSON output, to make it obvious that proper way to serializeJsonNode
s is to do useObjectMapper.writeValueAsString()
(or equivalent).But with #2176 we have a better way: we can produce valid JSON with standard/vanilla settings.
This should be convenient for many "casual JSON" use cases, and would achieve the goals of:
The text was updated successfully, but these errors were encountered: