File tree Expand file tree Collapse file tree 3 files changed +22
-17
lines changed
src/main/java/org/mule/extension/jsonlogger/internal Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 44 <modelVersion >4.0.0</modelVersion >
55 <groupId >cloud.anypoint</groupId >
66 <artifactId >json-logger</artifactId >
7- <version >3.0.3 -SNAPSHOT</version >
7+ <version >3.1.0 -SNAPSHOT</version >
88 <packaging >mule-extension</packaging >
99 <name >JSON Logger</name >
1010
103103 <artifactId >jackson-databind</artifactId >
104104 <version >2.20.1</version >
105105 </dependency >
106+ <dependency >
107+ <groupId >com.fasterxml.jackson.datatype</groupId >
108+ <artifactId >jackson-datatype-jdk8</artifactId >
109+ <version >2.20.1</version >
110+ </dependency >
106111 <dependency >
107112 <groupId >commons-beanutils</groupId >
108113 <artifactId >commons-beanutils</artifactId >
Original file line number Diff line number Diff line change 11package org .mule .extension .jsonlogger .internal .datamask ;
22
3- import com .fasterxml .jackson .annotation .JsonInclude ;
4- import com .fasterxml .jackson .core .JsonProcessingException ;
3+ import java .util .Collection ;
4+ import java .util .Collections ;
5+ import java .util .HashSet ;
6+ import java .util .Iterator ;
7+ import java .util .Map ;
8+ import java .util .Set ;
9+ import java .util .regex .Pattern ;
10+
511import com .fasterxml .jackson .databind .JsonNode ;
6- import com .fasterxml .jackson .databind .MapperFeature ;
7- import com .fasterxml .jackson .databind .ObjectMapper ;
8- import com .fasterxml .jackson .databind .SerializationFeature ;
912import com .fasterxml .jackson .databind .node .ArrayNode ;
1013import com .fasterxml .jackson .databind .node .ObjectNode ;
1114import com .fasterxml .jackson .databind .node .TextNode ;
1417import com .jayway .jsonpath .Option ;
1518import com .jayway .jsonpath .spi .json .JacksonJsonNodeJsonProvider ;
1619
17- import java .util .*;
18- import java .util .regex .Pattern ;
19-
2020public class JsonMasker {
2121
2222 private static final Pattern digits = Pattern .compile ("\\ d" );
@@ -130,4 +130,4 @@ private static String maskNumber(String value) {
130130 return value .replaceAll ("[0-9]" , "*" );
131131 }
132132
133- }
133+ }
Original file line number Diff line number Diff line change 11package org .mule .extension .jsonlogger .internal .singleton ;
22
3- import com .fasterxml .jackson .annotation .JsonInclude ;
4- import com .fasterxml .jackson .databind .MapperFeature ;
3+ import com .fasterxml .jackson .annotation .JsonInclude .Include ;
54import com .fasterxml .jackson .databind .ObjectMapper ;
6- import com .fasterxml .jackson .databind .SerializationFeature ;
5+ import com .fasterxml .jackson .databind .json .JsonMapper ;
6+ import com .fasterxml .jackson .datatype .jdk8 .Jdk8Module ;
77
88public class ObjectMapperSingleton {
99
1010 // JSON Object Mapper
11- private final ObjectMapper om = new ObjectMapper ()
12- .setSerializationInclusion ( JsonInclude . Include . NON_NULL );
13- // .configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true )
14- // .configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true );
11+ private final ObjectMapper om = JsonMapper . builder ()
12+ .addModule ( new Jdk8Module ())
13+ .serializationInclusion ( Include . NON_NULL )
14+ .build ( );
1515
1616 public ObjectMapper getObjectMapper () {
1717 return this .om ;
You can’t perform that action at this time.
0 commit comments