Closed dewarim closed 1 year ago
Ok it may be worth trying to change serializer to not try to write an object but instead
jsonGenerator.writeFieldName("content");
jsonGenerator.writeRawValue(core.content);
and see if that helps (note writeRawValue()
instead of writeRaw()
, to ensure writer state is updated so that a value has been written).
Thank you, this seems to solve the issue.
@dewarim Thank you for update & glad things worked out!
Using: 2.14.2
When serializing a single object which uses a custom serializer, I get the expected XML result. When the object is part of a list in a wrapper object, I get an exception:
com.fasterxml.jackson.databind.JsonMappingException: Current context not Array but Object (through reference chain: com.dewarim.SerializerTest$CoreWrapper["core"])
Small test project: https://github.com/dewarim/jackson-xml-debug2