Skip to content

Commit 42897e8

Browse files
Better JSON array pretty printing
1 parent 57c9d9f commit 42897e8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

typescript-generator-core/src/main/java/cz/habarta/typescript/generator/util/StandardJsonPrettyPrinter.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,15 @@ public void writeObjectFieldValueSeparator(JsonGenerator jg) throws IOException
3838
jg.writeRaw(": ");
3939
}
4040

41+
@Override
42+
public void writeEndArray(JsonGenerator g, int nrOfValues) throws IOException {
43+
if (!_arrayIndenter.isInline()) {
44+
--_nesting;
45+
}
46+
if (nrOfValues > 0) {
47+
_arrayIndenter.writeIndentation(g, _nesting);
48+
}
49+
g.writeRaw(']');
50+
}
51+
4152
}

0 commit comments

Comments
 (0)