如何使用Jackson将原始JSON包含在对象中?
当使用Jackson对对象进行反序列化时,我试图在Java对象中包含原始JSON。为了测试此功能,我编写了以下测试: public static class Pojo { public String foo; @JsonRawValue public String bar; } @Test public void test() throws JsonGenerationException, JsonMappingException, IOException { String foo = "one"; String bar = "{\"A\":false}"; Pojo pojo = new Pojo(); pojo.foo = foo; pojo.bar = bar; String json = "{\"foo\":\"" + foo + "\",\"bar\":" …