Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix jackson object mapper config

Rich Turner6f2f46631292
diff --git a/model/src/main/java/org/openremote/model/util/ValueUtil.java b/model/src/main/java/org/openremote/model/util/ValueUtil.java
index 1d04c1997..3d3d6f81a 100644
--- a/model/src/main/java/org/openremote/model/util/ValueUtil.java
+++ b/model/src/main/java/org/openremote/model/util/ValueUtil.java
@@ -150,7 +150,7 @@ public class ValueUtil {
public static ObjectMapper configureObjectMapper(ObjectMapper objectMapper) {
objectMapper
- .setConstructorDetector(ConstructorDetector.USE_PROPERTIES_BASED)
+ .setConstructorDetector(ConstructorDetector.DEFAULT)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.configure(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS, false) // see https://github.com/FasterXML/jackson-databind/issues/1547
.configure(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, false)
@@ -162,7 +162,7 @@ public class ValueUtil {
.setVisibility(PropertyAccessor.CREATOR, JsonAutoDetect.Visibility.ANY)
.registerModule(new Jdk8Module())
.registerModule(new JavaTimeModule())
- .registerModule(new ParameterNamesModule(JsonCreator.Mode.PROPERTIES));
+ .registerModule(new ParameterNamesModule(JsonCreator.Mode.DEFAULT));
objectMapper.configOverride(Map.class)
.setInclude(JsonInclude.Value.construct(JsonInclude.Include.NON_NULL, JsonInclude.Include.NON_NULL));