mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-08 11:34:43 +08:00
Pass test case for empty tag with forceList
This commit is contained in:
@@ -415,7 +415,7 @@ public class XML {
|
||||
if (parse(x, jsonObject, tagName, config)) {
|
||||
if (config.getForceList().contains(tagName)) {
|
||||
if (jsonObject.length() == 0) {
|
||||
context.append(tagName, "");
|
||||
context.put(tagName, new JSONArray());
|
||||
} else if (jsonObject.length() == 1
|
||||
&& jsonObject.opt(config.getcDataTagName()) != null) {
|
||||
context.append(tagName, jsonObject.opt(config.getcDataTagName()));
|
||||
|
Reference in New Issue
Block a user