Skip to content

Commit

Permalink
Configure Jackson for nanosecond precision
Browse files Browse the repository at this point in the history
Closes gh-9461
  • Loading branch information
jzheaux committed Feb 17, 2021
1 parent a0a9718 commit 5e5ff27
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.stream.Collectors;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.DecimalUtils;
import org.junit.Before;
Expand Down Expand Up @@ -64,6 +65,9 @@ public void setup() {
ClassLoader loader = getClass().getClassLoader();
this.mapper = new ObjectMapper();
this.mapper.registerModules(SecurityJackson2Modules.getModules(loader));

// see https://github.com/FasterXML/jackson-databind/issues/3052 for details
this.mapper.configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true);
}

@Test
Expand Down

0 comments on commit 5e5ff27

Please sign in to comment.