Pass test case for empty tag with forceList

This commit is contained in:
Zach
2021-11-19 21:05:05 -06:00
parent 3f9b53fee4
commit e638955034
2 changed files with 34 additions and 15 deletions

View File

@@ -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()));