美文网首页
SpringBoot | com.alibaba.fastjso

SpringBoot | com.alibaba.fastjso

作者: Ada54 | 来源:发表于2019-11-07 17:14 被阅读0次

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}");

相关文章

网友评论

      本文标题:SpringBoot | com.alibaba.fastjso

      本文链接:https://www.haomeiwen.com/subject/vqbvbctx.html