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