SpringBoot | com.alibaba.fastjso

2019-11-07  本文已影响0人  Ada54

com.alibaba.fastjson.JSONArray cannot be cast to com.alibaba.fastjson.JSONObject

json中类型转换问题:

[{}]是错误的格式

错误写法:

JSONObject.parseObject("[{\"type\":\"table\",\"show\":\"true\",\"start\":1,\"end\":20}]");

正确写法:

JSONObject.parseObject("{\"type\":\"table\",\"show\":\"true\",\"start\":1,\"end\":20}");

上一篇 下一篇

猜你喜欢

热点阅读