File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/utils Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com .algolia .utils ;
2
2
3
+ import static com .fasterxml .jackson .core .JsonGenerator .Feature ;
4
+
3
5
import com .fasterxml .jackson .annotation .*;
4
6
import com .fasterxml .jackson .databind .*;
5
7
import com .fasterxml .jackson .databind .json .JsonMapper ;
@@ -19,8 +21,11 @@ public ObjectMapper build() {
19
21
ObjectMapper mapper = JsonMapper .builder ().disable (MapperFeature .ALLOW_COERCION_OF_SCALARS ).build ();
20
22
mapper .setSerializationInclusion (JsonInclude .Include .NON_NULL );
21
23
mapper .configure (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES , this .failOnUnknown );
24
+ mapper .enable (Feature .AUTO_CLOSE_JSON_CONTENT );
22
25
mapper .enable (DeserializationFeature .FAIL_ON_INVALID_SUBTYPE );
23
26
mapper .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS );
27
+ mapper .disable (SerializationFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS );
28
+ mapper .disable (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS );
24
29
mapper .enable (SerializationFeature .WRITE_ENUMS_USING_TO_STRING );
25
30
mapper .enable (DeserializationFeature .READ_ENUMS_USING_TO_STRING );
26
31
return mapper ;
You can’t perform that action at this time.
0 commit comments