fix(serialize-json): port comment post processing from xml to remove empty comments
This commit is contained in:
parent
30f18ecef9
commit
0f8a549495
|
@ -183,9 +183,11 @@ public class JsonWriter extends SerializeWriter<IOException, JsonWriter> impleme
|
|||
if (!deferredComments.isEmpty()) {
|
||||
if (newline.isEmpty()) {
|
||||
out.append("/* ")
|
||||
.append(String.join(" / ", deferredComments)
|
||||
.replace("*/", "#/"))
|
||||
.append(" */");
|
||||
.append(String.join(" / ", deferredComments.stream()
|
||||
.filter(s -> s != null && !s.isBlank())
|
||||
.map(s -> s.replace("/*", "#/"))
|
||||
.toList())
|
||||
).append(" */");
|
||||
} else {
|
||||
boolean first = true;
|
||||
for (String s : deferredComments) {
|
||||
|
|
Loading…
Reference in New Issue