Skip to content
Merged
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 @@ -49,7 +49,9 @@ public DefaultPrettyPrinter withSeparators(Separators separators) {
this.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
this.setSerializationInclusion(JsonInclude.Include.NON_NULL);

this.findAndRegisterModules();
if (shouldFindAndRegisterModules()) {
this.findAndRegisterModules();
}

this.setVisibility(
this.getSerializationConfig()
Expand All @@ -69,6 +71,14 @@ public DefaultPrettyPrinter withSeparators(Separators separators) {
*/
public void configure(ObjectMapper objectMapper) {}

/**
* Override to control the registration of all available jackson modules within the classpath
* which are locatable via JDK ServiceLoader facility, along with module-provided SPI.
*/
protected boolean shouldFindAndRegisterModules() {
return true;
}

@Override
public Snapshot apply(Object object, SnapshotSerializerContext gen) {
try {
Expand Down