Skip to content

Commit

Permalink
Serialize timestamps properly
Browse files Browse the repository at this point in the history
  • Loading branch information
schnapster committed Feb 20, 2025
1 parent 9988597 commit 665a167
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ org.gradle.warning.mode=all
# Build broken due to warnings from KAPT: https://youtrack.jetbrains.com/issue/KT-68400/K2-w-Kapt-currently-doesnt-support-language-version-2.0.-Falling-back-to-1.9.
#kapt.use.k2=true

shipaVersion=0.8.1
shipaVersion=0.8.2

theJavaVersion=21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dev.capybaralabs.shipa.jackson
import com.fasterxml.jackson.annotation.JsonInclude.Include
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.PropertyNamingStrategies
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.databind.json.JsonMapper
import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.databind.type.SimpleType
Expand All @@ -24,6 +25,7 @@ class ShipaJsonMapper {
propertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE)
disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) // write dates as ISO strings

val intBitfieldDeserializer = IntBitfieldDeserializer(SimpleType.constructUnsafe(Void::class.java))
val stringBitfieldDeserializer = StringBitfieldDeserializer(SimpleType.constructUnsafe(Void::class.java))
Expand Down

0 comments on commit 665a167

Please sign in to comment.