Is it possible to make Jackson serialize a nested object as a string
问题 Given these classes: @Value private static class Message { private final String type; private final MyType message; } @Value public class MyType { private final String foo; } Jackson will produce: { "Type" : "Test", "Message" : {"foo" : "bar"} } Is there some type of annotation or instruction I can give to Jackson to ask it to serialize the nested complex type as a string, e.g. the desired JSON would be: { "Type" : "Test", "Message" : "{\"foo\" : \"bar\"}" } I tried both of these annotations