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 039c2c5 commit 56fc9fa
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -188,6 +189,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)
Expand Down Expand Up @@ -249,6 +251,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 {
Expand All @@ -259,5 +262,4 @@ public static ObjectMapper buildStrictGenericObjectMapper() {

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

}

0 comments on commit 56fc9fa

Please sign in to comment.