james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [09/21] james-project git commit: JAMES-2272 JSON transformer should be able to serialize ZonedDateTime
Date Thu, 04 Jan 2018 08:13:24 GMT
JAMES-2272 JSON transformer should be able to serialize ZonedDateTime


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/1b7e8d74
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/1b7e8d74
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/1b7e8d74

Branch: refs/heads/master
Commit: 1b7e8d74553fef6bf74df6598ad010a01dbc4b01
Parents: 4eeede9
Author: benwa <btellier@linagora.com>
Authored: Wed Dec 27 14:29:44 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Thu Jan 4 15:03:36 2018 +0700

----------------------------------------------------------------------
 pom.xml                                                      | 2 +-
 server/protocols/webadmin/webadmin-core/pom.xml              | 4 ++++
 .../org/apache/james/webadmin/utils/JsonTransformer.java     | 8 +++++---
 3 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/1b7e8d74/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index fdd34c0..2676c2e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1426,7 +1426,7 @@
             <dependency>
                 <groupId>com.fasterxml.jackson.datatype</groupId>
                 <artifactId>jackson-datatype-jsr310</artifactId>
-                <version>2.6.3</version>
+                <version>${jackson-databinding.version}</version>
             </dependency>
             <dependency>
                 <groupId>com.github.dpaukov</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1b7e8d74/server/protocols/webadmin/webadmin-core/pom.xml
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-core/pom.xml b/server/protocols/webadmin/webadmin-core/pom.xml
index 32f8b5f..56bcda1 100644
--- a/server/protocols/webadmin/webadmin-core/pom.xml
+++ b/server/protocols/webadmin/webadmin-core/pom.xml
@@ -63,6 +63,10 @@
             <artifactId>jackson-datatype-jdk8</artifactId>
         </dependency>
         <dependency>
+            <groupId>com.fasterxml.jackson.datatype</groupId>
+            <artifactId>jackson-datatype-jsr310</artifactId>
+        </dependency>
+        <dependency>
             <groupId>com.github.fge</groupId>
             <artifactId>throwing-lambdas</artifactId>
         </dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/1b7e8d74/server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/utils/JsonTransformer.java
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/utils/JsonTransformer.java
b/server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/utils/JsonTransformer.java
index 722f8ec..6fd8f8c 100644
--- a/server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/utils/JsonTransformer.java
+++ b/server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/utils/JsonTransformer.java
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 
 import spark.ResponseTransformer;
 
@@ -31,9 +32,10 @@ public class JsonTransformer implements ResponseTransformer {
     private final ObjectMapper objectMapper;
 
     public JsonTransformer() {
-        objectMapper = new ObjectMapper();
-        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
-        objectMapper.registerModule(new Jdk8Module());
+        objectMapper = new ObjectMapper()
+            .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
+            .registerModule(new Jdk8Module())
+            .registerModule(new JavaTimeModule());
     }
 
     @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message