Skip to content

Commit

Permalink
leshan: fix problem with timestamped data serializer
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Remmert <jremmert@gmx.net>
  • Loading branch information
jonas-rem committed Sep 12, 2024
1 parent a835704 commit 6a020ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/leshan/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<version>6.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.17.2</version>
</dependency>
</dependencies>

<build>
Expand Down
2 changes: 2 additions & 0 deletions server/leshan/src/main/java/lwm2m/LeshanSvr.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -96,6 +97,7 @@ public LeshanSvr() {
module.addSerializer(LwM2mNode.class, new JacksonLwM2mNodeSerializer());
module.addSerializer(Version.class, new JacksonVersionSerializer());
mapper.registerModule(module);
mapper.registerModule(new JavaTimeModule());

server.getRegistrationService().addListener(new MyRegistrationListener(this));
server.getObservationService().addListener(new MyObservationListener(this));
Expand Down

0 comments on commit 6a020ac

Please sign in to comment.