Skip to content

Commit

Permalink
Fix #41: propagate configured PrettyPrinter to JsonGenerator (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder authored Jan 5, 2025
1 parent 7b42f93 commit 1e1aee5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,12 @@ public void writeTo(Object value, Class<?> type, Type genericType, Annotation[]
try {
// Want indentation?
if (writer.isEnabled(SerializationFeature.INDENT_OUTPUT)) {
g.useDefaultPrettyPrinter();
PrettyPrinter defaultPrettyPrinter = writer.getConfig().getDefaultPrettyPrinter();
if (defaultPrettyPrinter != null) {
g.setPrettyPrinter(defaultPrettyPrinter);
} else {
g.useDefaultPrettyPrinter();
}
}
JavaType rootType = null;

Expand Down
2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Sub-modules:
#36: Narrow types to format specific (e.g. CBORMapper) when resolving
via JAX-RS Providers
(suggested by Kevin W)
#41: Configure `PrettyPrinter` not correctly propagated to underlying
`JsonGenerator`
* Woodstox dependency now 7.1.0

2.18.2 (27-Nov-2024)
Expand Down

0 comments on commit 1e1aee5

Please sign in to comment.