diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/ArrayType.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/ArrayType.java index f9b853a85f..b085bfcdec 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/ArrayType.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/ArrayType.java @@ -3,8 +3,8 @@ package com.appsmith.external.datatypes; import com.appsmith.external.constants.DataType; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import net.minidev.json.JSONArray; import net.minidev.json.parser.JSONParser; @@ -12,8 +12,7 @@ import reactor.core.Exceptions; public class ArrayType implements AppsmithType { - private static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + private static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); @Override public boolean test(String s) { diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/DateType.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/DateType.java index 596cfcdf68..2d1e479900 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/DateType.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/DateType.java @@ -3,8 +3,8 @@ package com.appsmith.external.datatypes; import com.appsmith.external.constants.DataType; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import reactor.core.Exceptions; @@ -16,8 +16,7 @@ import java.util.regex.Matcher; public class DateType implements AppsmithType { - private static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + private static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); @Override public boolean test(String s) { diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/JsonObjectType.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/JsonObjectType.java index 6fd9a92adf..77a64b1a04 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/JsonObjectType.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/JsonObjectType.java @@ -3,8 +3,8 @@ package com.appsmith.external.datatypes; import com.appsmith.external.constants.DataType; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import com.google.gson.JsonObject; @@ -22,8 +22,7 @@ import java.util.regex.Matcher; public class JsonObjectType implements AppsmithType { private static final TypeAdapter strictGsonObjectAdapter = new Gson().getAdapter(JsonObject.class); - private static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + private static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); @Override public boolean test(String s) { diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/StringType.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/StringType.java index 8e9e1c19ab..7b1d0fedee 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/StringType.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/StringType.java @@ -3,8 +3,8 @@ package com.appsmith.external.datatypes; import com.appsmith.external.constants.DataType; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import reactor.core.Exceptions; @@ -12,8 +12,7 @@ import java.util.regex.Matcher; public class StringType implements AppsmithType { - private static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + private static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); @Override public boolean test(String s) { diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/TimeType.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/TimeType.java index 101df6be25..d56743b2b3 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/TimeType.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/TimeType.java @@ -3,8 +3,8 @@ package com.appsmith.external.datatypes; import com.appsmith.external.constants.DataType; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import reactor.core.Exceptions; @@ -16,8 +16,7 @@ import java.util.regex.Matcher; public class TimeType implements AppsmithType { - private static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + private static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); @Override public boolean test(String s) { diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/TimestampType.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/TimestampType.java index 69b7728a56..12bcd75028 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/TimestampType.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/datatypes/TimestampType.java @@ -3,8 +3,8 @@ package com.appsmith.external.datatypes; import com.appsmith.external.constants.DataType; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import reactor.core.Exceptions; @@ -16,8 +16,7 @@ import java.util.regex.Matcher; public class TimestampType implements AppsmithType { - private static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + private static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); @Override public boolean test(String s) { diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/DataTypeStringUtils.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/DataTypeStringUtils.java index 071b6ec2c0..950850a20c 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/DataTypeStringUtils.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/DataTypeStringUtils.java @@ -8,8 +8,8 @@ import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException import com.appsmith.external.models.Param; import com.appsmith.external.models.ParsedDataType; import com.appsmith.external.plugins.SmartSubstitutionInterface; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -54,8 +54,7 @@ public class DataTypeStringUtils { public static Pattern placeholderPattern = Pattern.compile(APPSMITH_SUBSTITUTION_PLACEHOLDER); - private static ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + private static ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); private static final TypeAdapter strictGsonObjectAdapter = new Gson().getAdapter(JsonObject.class); diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/PluginUtils.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/PluginUtils.java index 009f04857e..43b8bd533c 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/PluginUtils.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/PluginUtils.java @@ -10,8 +10,8 @@ import com.appsmith.external.models.DatasourceConfiguration; import com.appsmith.external.models.Endpoint; import com.appsmith.external.models.Param; import com.appsmith.external.models.Property; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; @@ -47,8 +47,7 @@ import static com.appsmith.external.constants.CommonFieldName.VALUE; @Slf4j public class PluginUtils { - private static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + private static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); public static final TypeReference STRING_TYPE = new TypeReference<>() { @Override public Type getType() { diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/DataUtils.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/DataUtils.java index eeb948322a..4ebf294ead 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/DataUtils.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/DataUtils.java @@ -7,8 +7,8 @@ import com.appsmith.external.helpers.PluginUtils; import com.appsmith.external.models.ActionConfiguration; import com.appsmith.external.models.ApiContentType; import com.appsmith.external.models.Property; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -77,7 +77,7 @@ public class DataUtils { } public DataUtils() { - this.objectMapper = new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + this.objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); this.objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); } diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/BasePlugin.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/BasePlugin.java index a9dada951f..17ca7b8cae 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/BasePlugin.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/plugins/BasePlugin.java @@ -1,14 +1,13 @@ package com.appsmith.external.plugins; -import com.fasterxml.jackson.core.StreamReadFeature; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.databind.ObjectMapper; import org.pf4j.Plugin; import org.pf4j.PluginWrapper; public abstract class BasePlugin extends Plugin { - protected static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + protected static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); public BasePlugin(PluginWrapper wrapper) { super(wrapper); diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/services/ce/FilterDataServiceCE.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/services/ce/FilterDataServiceCE.java index d63c32361b..b0ec7e0129 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/services/ce/FilterDataServiceCE.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/services/ce/FilterDataServiceCE.java @@ -8,7 +8,7 @@ import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; import com.appsmith.external.models.Condition; import com.appsmith.external.models.UQIDataFilterParams; -import com.fasterxml.jackson.core.StreamReadFeature; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; @@ -98,7 +98,7 @@ public class FilterDataServiceCE implements IFilterDataServiceCE { public FilterDataServiceCE() { - objectMapper = new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); try { connection = DriverManager.getConnection(URL); diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/util/SerializationUtils.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/util/SerializationUtils.java index 7f81862616..b123faedb6 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/util/SerializationUtils.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/util/SerializationUtils.java @@ -69,4 +69,8 @@ public class SerializationUtils { builder.registerTypeAdapter(HttpMethod.class, new HttpMethodConverter()); }; } + + public static ObjectMapper getObjectMapperWithSourceInLocationEnabled() { + return new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + } } diff --git a/app/server/appsmith-plugins/firestorePlugin/src/main/java/com/external/utils/WhereConditionUtils.java b/app/server/appsmith-plugins/firestorePlugin/src/main/java/com/external/utils/WhereConditionUtils.java index 0cc59580c9..44a4b30edc 100644 --- a/app/server/appsmith-plugins/firestorePlugin/src/main/java/com/external/utils/WhereConditionUtils.java +++ b/app/server/appsmith-plugins/firestorePlugin/src/main/java/com/external/utils/WhereConditionUtils.java @@ -5,8 +5,8 @@ import com.appsmith.external.constants.DataType; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; import com.appsmith.external.helpers.DataTypeStringUtils; +import com.appsmith.util.SerializationUtils; import com.external.plugins.exceptions.FirestoreErrorMessages; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.cloud.firestore.FieldPath; import com.google.cloud.firestore.Query; @@ -20,8 +20,7 @@ import java.util.List; public class WhereConditionUtils { - protected static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + protected static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); public static Query applyWhereConditional(Query query, String strPath, String operatorString, String strValue) throws AppsmithPluginException { diff --git a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/GetDatasourceMetadataMethod.java b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/GetDatasourceMetadataMethod.java index 97609cde72..b3d4fdca58 100644 --- a/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/GetDatasourceMetadataMethod.java +++ b/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/GetDatasourceMetadataMethod.java @@ -4,9 +4,9 @@ import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; import com.appsmith.external.models.DatasourceConfiguration; import com.appsmith.external.models.Property; +import com.appsmith.util.SerializationUtils; import com.appsmith.util.WebClientUtils; import com.external.constants.FieldName; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; @@ -29,8 +29,7 @@ import static org.springframework.util.StringUtils.hasLength; @Slf4j public class GetDatasourceMetadataMethod { - protected static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + protected static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); public static Mono getDatasourceMetadata(DatasourceConfiguration datasourceConfiguration) { diff --git a/app/server/appsmith-plugins/graphqlPlugin/src/main/java/com/external/utils/GraphQLDataTypeUtils.java b/app/server/appsmith-plugins/graphqlPlugin/src/main/java/com/external/utils/GraphQLDataTypeUtils.java index b8b2ea7128..1f24392ce6 100644 --- a/app/server/appsmith-plugins/graphqlPlugin/src/main/java/com/external/utils/GraphQLDataTypeUtils.java +++ b/app/server/appsmith-plugins/graphqlPlugin/src/main/java/com/external/utils/GraphQLDataTypeUtils.java @@ -2,8 +2,8 @@ package com.external.utils; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import graphql.parser.InvalidSyntaxException; import graphql.parser.Parser; @@ -20,8 +20,7 @@ import static com.appsmith.external.helpers.SmartSubstitutionHelper.APPSMITH_SUB public class GraphQLDataTypeUtils { public static final String GRAPHQL_BODY_ENDS_WITH_PARAM_REGEX = "[\\w\\W]+:$"; - public static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + public static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); public static String smartlyReplaceGraphQLQueryBodyPlaceholderWithValue( String queryBody, String replacement, List> insertedParams) { diff --git a/app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/commands/MongoCommand.java b/app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/commands/MongoCommand.java index 6e4006269a..f92f9f8f8b 100644 --- a/app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/commands/MongoCommand.java +++ b/app/server/appsmith-plugins/mongoPlugin/src/main/java/com/external/plugins/commands/MongoCommand.java @@ -4,9 +4,9 @@ import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException import com.appsmith.external.helpers.PluginUtils; import com.appsmith.external.models.ActionConfiguration; import com.appsmith.external.models.DatasourceStructure; +import com.appsmith.util.SerializationUtils; import com.external.plugins.exceptions.MongoPluginError; import com.external.plugins.exceptions.MongoPluginErrorMessages; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.Getter; import lombok.NoArgsConstructor; @@ -33,8 +33,7 @@ import static com.external.plugins.constants.FieldName.COLLECTION; public abstract class MongoCommand { String collection; List fieldNamesWithNoConfiguration; - protected static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + protected static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); public MongoCommand(ActionConfiguration actionConfiguration) { diff --git a/app/server/appsmith-plugins/mysqlPlugin/src/main/java/com/external/plugins/datatypes/MySQLDateTimeType.java b/app/server/appsmith-plugins/mysqlPlugin/src/main/java/com/external/plugins/datatypes/MySQLDateTimeType.java index b5344b7ec3..4ce8359f0d 100644 --- a/app/server/appsmith-plugins/mysqlPlugin/src/main/java/com/external/plugins/datatypes/MySQLDateTimeType.java +++ b/app/server/appsmith-plugins/mysqlPlugin/src/main/java/com/external/plugins/datatypes/MySQLDateTimeType.java @@ -4,8 +4,8 @@ import com.appsmith.external.constants.DataType; import com.appsmith.external.datatypes.AppsmithType; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginError; import com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException; +import com.appsmith.util.SerializationUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.ObjectMapper; import reactor.core.Exceptions; @@ -16,8 +16,7 @@ import java.time.format.DateTimeParseException; import java.util.regex.Matcher; public class MySQLDateTimeType implements AppsmithType { - private static final ObjectMapper objectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + private static final ObjectMapper objectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); @Override public boolean test(String s) { diff --git a/app/server/appsmith-plugins/saasPlugin/src/main/java/com/external/plugins/SaasPlugin.java b/app/server/appsmith-plugins/saasPlugin/src/main/java/com/external/plugins/SaasPlugin.java index 18383c5c84..f1b1535305 100644 --- a/app/server/appsmith-plugins/saasPlugin/src/main/java/com/external/plugins/SaasPlugin.java +++ b/app/server/appsmith-plugins/saasPlugin/src/main/java/com/external/plugins/SaasPlugin.java @@ -12,13 +12,13 @@ import com.appsmith.external.plugins.BasePlugin; import com.appsmith.external.plugins.PluginExecutor; import com.appsmith.external.plugins.SmartSubstitutionInterface; import com.appsmith.external.services.SharedConfig; +import com.appsmith.util.SerializationUtils; import com.appsmith.util.WebClientUtils; import com.external.helpers.RequestCaptureFilter; import com.external.plugins.exceptions.SaaSErrorMessages; import com.external.plugins.exceptions.SaaSPluginError; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadFeature; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -61,8 +61,7 @@ public class SaasPlugin extends BasePlugin { // Setting max content length. This would've been coming from `spring.codec.max-in-memory-size` property if the // `WebClient` instance was loaded as an auto-wired bean. private final ExchangeStrategies EXCHANGE_STRATEGIES; - private final ObjectMapper saasObjectMapper = - new ObjectMapper().enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION.mappedFeature()); + private final ObjectMapper saasObjectMapper = SerializationUtils.getObjectMapperWithSourceInLocationEnabled(); public SaasPluginExecutor(SharedConfig sharedConfig) { this.sharedConfig = sharedConfig;