You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
转换的类里面集合有set属性时,会报错
Exception in thread "Thread-22" Exception in thread "Thread-21" com.alibaba.fastjson2.JSONException: can not cast to java.util.Set,
问题描述
简要描述您碰到的问题。
JSONObject 转 Object 问题
转换的类里面集合有set属性时,会报错
Exception in thread "Thread-22" Exception in thread "Thread-21" com.alibaba.fastjson2.JSONException: can not cast to java.util.Set,
用fastjson 1.x版本不存在这个问题,看源码是因为 jsonArray 1.x版本中用的Collection接收,进行转换不存在这个问题。
而fastjson2 会通过ObjectReaderProvider找到对应的reader去转换对象,而目前默认没有jsonArray 转 Set这种reader,
所以现在有什么简单方式实现我这个需求么。
环境信息
请填写以下信息:
The text was updated successfully, but these errors were encountered: