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 (!deferredComments.isEmpty()) {
|
||||||
if (newline.isEmpty()) {
|
if (newline.isEmpty()) {
|
||||||
out.append("/* ")
|
out.append("/* ")
|
||||||
.append(String.join(" / ", deferredComments)
|
.append(String.join(" / ", deferredComments.stream()
|
||||||
.replace("*/", "#/"))
|
.filter(s -> s != null && !s.isBlank())
|
||||||
.append(" */");
|
.map(s -> s.replace("/*", "#/"))
|
||||||
|
.toList())
|
||||||
|
).append(" */");
|
||||||
} else {
|
} else {
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (String s : deferredComments) {
|
for (String s : deferredComments) {
|
||||||
|
|
Loading…
Reference in New Issue