From 5a93cf5000e8204c980e953e9fd6ebc7652fb1b5 Mon Sep 17 00:00:00 2001 From: Hleb Albau Date: Wed, 23 May 2018 17:42:55 +0300 Subject: [PATCH] #132 Wrong ETH Contract Balance -- store numbers as plain string --- .../main/kotlin/fund/cyber/search/Serialization.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/common/src/main/kotlin/fund/cyber/search/Serialization.kt b/common/src/main/kotlin/fund/cyber/search/Serialization.kt index 053eca64..f0ee4016 100644 --- a/common/src/main/kotlin/fund/cyber/search/Serialization.kt +++ b/common/src/main/kotlin/fund/cyber/search/Serialization.kt @@ -8,11 +8,14 @@ import com.fasterxml.jackson.datatype.jdk8.Jdk8Module import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import com.fasterxml.jackson.module.kotlin.registerKotlinModule -val jsonSerializer = ObjectMapper().registerKotlinModule() - .registerModule(Jdk8Module()) - .registerModule(JavaTimeModule()) +val jsonSerializer = ObjectMapper() + .enable(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS) + .enable(JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN) .setSerializationInclusion(JsonInclude.Include.NON_NULL) - .enable(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS)!! + .registerKotlinModule() + .registerModule(Jdk8Module()) + .registerModule(JavaTimeModule())!! + val jsonDeserializer = ObjectMapper().registerKotlinModule() .registerModule(Jdk8Module())