fix: toJson 직렬화 시 빈 항목 제외 처리
itemPart가 비어있을 경우 구분자와 내용을 출력하지 않도록 수정. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -783,12 +783,15 @@ public class StandardItem implements Serializable, Cloneable {
|
||||
if(p>0) sb.append(",");
|
||||
sb.append("{");
|
||||
while(keyIter.hasNext()) {
|
||||
if(ai>0) sb.append(",");
|
||||
String key = keyIter.next();
|
||||
StandardItem item = group.get(key);
|
||||
if(showPretty) sb.append("\n");
|
||||
sb.append(item.toJson(showPretty, withBizData));
|
||||
ai++;
|
||||
String itemPart = item.toJson(showPretty, withBizData);
|
||||
if(StringUtils.isNotEmpty(itemPart)) {
|
||||
if(ai>0) sb.append(",");
|
||||
if(showPretty) sb.append("\n");
|
||||
sb.append(itemPart);
|
||||
ai++;
|
||||
}
|
||||
}
|
||||
|
||||
if(showPretty) {
|
||||
|
||||
Reference in New Issue
Block a user