Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate the pretty printer from the writer to the generator in ProviderBase.writeTo() #205

Merged
merged 2 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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