Skip to content

Commit

Permalink
Propagate the pretty printer from the writer to the generator in `Pro…
Browse files Browse the repository at this point in the history
…viderBase.writeTo()` (#205)
  • Loading branch information
motlin authored Jan 5, 2025
1 parent 1242dd8 commit db934e1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,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
6 changes: 6 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,9 @@ Yura (@sdyura)
* Contributed #193: `JacksonJaxbJsonProvider` has @Produces(MediaType.WILDCARD) and yet
hasMatchingMediaType(MediaType.WILDCARD) return false
(2.18.0)

Craig P. Motlin (@motlin)

* Contributed #205: Propagate the pretty printer from the writer to the generator in
ProviderBase.writeTo()
(2.19.0)
3 changes: 3 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Sub-modules:

#200: Narrow types to format specific (e.g. CBORMapper) when resolving
via JAX-RS Providers
#205: Propagate the pretty printer from the writer to the generator in
ProviderBase.writeTo()
(contributed by @motlin)
* Woodstox dependency now 7.1.0

2.18.2 (27-Nov-2024)
Expand Down

0 comments on commit db934e1

Please sign in to comment.