|
41 | 41 | import com.datastax.astra.client.model.UUIDv6;
|
42 | 42 | import com.datastax.astra.client.model.UUIDv7;
|
43 | 43 | import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
| 44 | +import com.fasterxml.jackson.core.JsonFactory; |
44 | 45 | import com.fasterxml.jackson.core.JsonParser;
|
45 | 46 | import com.fasterxml.jackson.core.JsonProcessingException;
|
| 47 | +import com.fasterxml.jackson.core.StreamReadFeature; |
| 48 | +import com.fasterxml.jackson.core.StreamWriteFeature; |
| 49 | +import com.fasterxml.jackson.core.json.JsonReadFeature; |
46 | 50 | import com.fasterxml.jackson.databind.DeserializationFeature;
|
47 | 51 | import com.fasterxml.jackson.databind.MapperFeature;
|
48 | 52 | import com.fasterxml.jackson.databind.ObjectMapper;
|
@@ -79,9 +83,14 @@ public class JsonUtils {
|
79 | 83 | */
|
80 | 84 | public static synchronized ObjectMapper getDataApiObjectMapper() {
|
81 | 85 | if (dataApiObjectMapper == null) {
|
82 |
| - dataApiObjectMapper = new ObjectMapper() |
83 |
| - .configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true) |
84 |
| - .configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true) |
| 86 | + JsonFactory jsonFactory = JsonFactory.builder() |
| 87 | + .enable(JsonReadFeature.ALLOW_SINGLE_QUOTES) |
| 88 | + .enable(JsonReadFeature.ALLOW_UNQUOTED_FIELD_NAMES) |
| 89 | + .enable(StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER) |
| 90 | + .enable(StreamReadFeature.USE_FAST_DOUBLE_PARSER) |
| 91 | + .enable(StreamWriteFeature.USE_FAST_DOUBLE_WRITER) |
| 92 | + .build(); |
| 93 | + dataApiObjectMapper = new ObjectMapper(jsonFactory) |
85 | 94 | .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true)
|
86 | 95 | .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
87 | 96 | .configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, false)
|
|
0 commit comments