Skip to content

Commit

Permalink
Add jackson time compatibility module to Redis Store (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
Doc94 authored Jul 23, 2024
2 parents 14fd452 + d895578 commit 4f9c5e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions redis/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dependencies {
api "io.lettuce:lettuce-core:$lettuce_version"
implementation "com.discord4j:discord-json-api:$discordJsonVersion"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jackson_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
annotationProcessor "com.austinv11.servicer:Servicer:$servicer_version"

testImplementation project(':tck')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.DeserializationProblemHandler;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import discord4j.discordjson.possible.PossibleFilter;
import discord4j.discordjson.possible.PossibleModule;
import discord4j.store.api.util.LongLongTuple2;
Expand Down Expand Up @@ -147,6 +148,7 @@ public static RedisSerializerFactory jacksonValueSerializerFactory() {
ObjectMapper mapper = new ObjectMapper()
.registerModule(new PossibleModule())
.registerModule(new Jdk8Module())
.registerModule(new JavaTimeModule())
.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE)
.setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.PUBLIC_ONLY)
.setVisibility(PropertyAccessor.CREATOR, JsonAutoDetect.Visibility.ANY)
Expand Down

0 comments on commit 4f9c5e7

Please sign in to comment.