Open fan-tom opened 4 years ago
Hmmh. I agree, this is bit tricky to analyze. I will have to look deeper into whether there is anything that could be done; embedded POJOs are problematic wrt such usage and handling here is split across multiple packages.
Note: for Hacktoberfest I would accept a simple unit tests to add on:
https://github.com/FasterXML/jackson-integration-tests
(master
is for 2.12 compatibility testing)
and no fix is required otherwise. Added "need-test-case" label to indicate this.
@fan-tom I suspect the usage as shown might be unsupportable: JsonNode.toString()
should only produce JSON, ever, regardless of backend, but type enclosed appears to be MessagePack-specific value.
However, since MessagePackExtensionType
is defined in jackson-dataformat-msgpack
, it technically could change behavior, to produce some other representation for diagnostics purposes. And in fact it probably should at least consider possible case of TokenBuffer
being underlying generator: this is required for buffering.
But this is not something that can be solved by jackson-databind
, unfortunately.
Describe the bug After upgrade from 2.9 to 2.10 next code starts throwing exception
Exception is thrown due to these lines from
org.msgpack:jackson-dataformat-msgpack
packagebecause
InternalNodeMapper
, used in 2.10 intoString
implementation doesn't take extensions into account, just uses defaultJsonMapper
and so on.I'm not sure is it bug or intended behaviour, but I tried to update package version and faced this issue. There are a lot of places where
toString
conversion is used (in debug/trace logs, where nodes are simply logged, so no direct calls totoString
are performed, it is in logger internals) and I'd like to have some workaround to be sure app will not crash due to this issue. Version information Which Jackson version(s) was this for? 2.10.2 Expected behavior No exception