Open nbartels opened 6 years ago
I have a object that contains a minimal-json JsonObject as field (...)
I understand the issue you are describing. However, I've never considered having a class with a JsonObject member. Does it make sense in your domain? Is it a payload-like field in a message-like object?
Does Jackson make this possible to fix in the calling code? Such as by registering an object capable of transforming JsonObject into something that Jackson can understand and vice-versa.
I have a object that contains a minimal-json JsonObject as field and I try to serialise the object with jackson to JSON to store the object as String and deserialise it afterwards. The mechanism is explained here:
http://www.baeldung.com/jackson-object-mapper-tutorial
As soon as I try to deserialise the stored object I run into this error message:
According to this message the default constructor is missing, but adding one seems not be a solution because
JsonNumber
,JsonString
andJsonLiteral
contain a inner private final field and it seems this disturbs the deserialisation process.ATM the solution is to store the JSON as String and have a getter that parses the String with minimal-json on demand, but perhaps you are interested in solving this on your side ;)