开发者社区> 问答> 正文

toJSONString()方法转成string有误差

{"FStockLocId":{"FSTOCKLOCID__FF100018":{"FNUMBER":"2222"},"FSTOCKLOCID__FF100017":{"FNUMBER":"2222"},"FSTOCKLOCID__FF100009":{"FNUMBER":"2222"},"FSTOCKLOCID__FF100003":{"FNUMBER":"2222"},"FSTOCKLOCID__FF100014":{"FNUMBER":"2222"},"FSTOCKLOCID__FF100002":{"FNUMBER":"2222"},"FSTOCKLOCID__FF100016":{"FNUMBER":"2222"},"FSTOCKLOCID__FF100004":{"FNUMBER":"2222"},"FSTOCKLOCID__FF100015":{"FNUMBER":"2222"}},"FEntryID":0,"FStockId":{"FNUMBER":"1"}} 一个这样的JsonObject,通过toJSONString()方法之后,转成了错误的string,如下: {"FStockLocId":{"FSTOCKLOCID__FF100018":{"FNUMBER":"2222"},"FSTOCKLOCID__FF100017":{"$ref":"$.FStockLocId.FSTOCKLOCID\_FF100018"},"FSTOCKLOCID__FF100009":{"$ref":"$.FStockLocId.FSTOCKLOCID\FF100018"},"FSTOCKLOCID__FF100003":{"$ref":"$.FStockLocId.FSTOCKLOCID\FF100018"},"FSTOCKLOCID__FF100014":{"$ref":"$.FStockLocId.FSTOCKLOCID\FF100018"},"FSTOCKLOCID__FF100002":{"$ref":"$.FStockLocId.FSTOCKLOCID\FF100018"},"FSTOCKLOCID__FF100016":{"$ref":"$.FStockLocId.FSTOCKLOCID\FF100018"},"FSTOCKLOCID__FF100004":{"$ref":"$.FStockLocId.FSTOCKLOCID\FF100018"},"FSTOCKLOCID__FF100015":{"$ref":"$.FStockLocId.FSTOCKLOCID\_FF100018"}},"FEntryID":0,"FStockId":{"FNUMBER":"1"}}。 使用JSONObject.parseObject()转成JSONObject是又正常的。但是我是需要这个string去掉别人第三方接口,第三方不一定是Java,那他去解析这个字符串就不正确了。

展开
收起
游客syeqbcmiqcia6 2022-11-04 11:24:37 184 0
0 条回答
写回答
取消 提交回答
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载

相关实验场景

更多