最近使用JsonNode解析json字符串时,遇到一个与预期不一致的小问题,记录一下~
先来看一个Test:
/**
* @author xudc
* @date 2019/5/7 16:42
*/
public class JsonNodeTest {
private final static String SUCC = "success";
@Test
public void testJsonNode() throws IOException {
String json = "{\"code\":\"success\",\"data\":{\"message\":\"操作成功\",\"timestamp\":1557214603}}";
ObjectMapper objectMapper = new ObjectMapper();
JsonNode jsonNode = objectMapper.readTree(json)<