-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE]含有重复key的json转为JSONObject使得重复的key元素的部分,合并为数组形式 #263
Labels
enhancement
New feature or request
Milestone
Comments
json规范没有规定这个吧 |
是的,所以这个 是在特殊情况下的 需求,不知道 大佬 如何 规划了😀 |
wenshao
added a commit
that referenced
this issue
May 30, 2022
wenshao
added a commit
that referenced
this issue
May 30, 2022
已经支持,请帮忙用2.0.6-SNAPSHOT版本验证,2.0.6正式版预计6月5日前发布 String str = "{\"item\":1,\"item\":2}";
JSONObject object = (JSONObject) JSON.parse(str, JSONReader.Feature.DuplicateKeyValueAsArray); 你可以这样用 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
请描述您的需求或者改进建议
可否实现 含有重复key的json字串转化jsonObject,使得重复的key元素的部分,合并为数组形式 效果呢?
请描述你建议的实现方案
按照标准json规范来将,此类情况应当为JSONArray 格式,
但是在解析 某些已有的数据时,会存在该种情况,且也会存在数据丢失的问题。
描述您考虑过的替代方案
使用net.sf.json.JSONObject 可以实现
附加信息
The text was updated successfully, but these errors were encountered: