Skip to content

Commit

Permalink
Enable INCLUDE_SOURCE_IN_LOCATION to restore Jackson pre-2.16 behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Philzen committed Jun 4, 2024
1 parent 41970c8 commit 6b52af9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.module.SimpleModule;
@@ -193,6 +194,7 @@ public JsonSerializer<?> modifySerializer(
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true)
.configure(JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION, true)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false)
.configure(JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN, true)
@@ -254,6 +256,7 @@ public static ObjectMapper buildStrictGenericObjectMapper() {
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true)
.configure(JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION, true)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);
try {
@@ -264,5 +267,4 @@ public static ObjectMapper buildStrictGenericObjectMapper() {

return mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
}

}

0 comments on commit 6b52af9

Please sign in to comment.