diff --git a/build.gradle b/build.gradle index 0db37435..4911ff05 100644 --- a/build.gradle +++ b/build.gradle @@ -57,8 +57,8 @@ dependencies { implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac' implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux' - implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.0' - implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.7.4' + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.2' + implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.17.2' testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: jUnitVersion diff --git a/src/main/java/seedu/address/commons/util/JsonUtil.java b/src/main/java/seedu/address/commons/util/JsonUtil.java index 100cb16c..abdbc7f3 100644 --- a/src/main/java/seedu/address/commons/util/JsonUtil.java +++ b/src/main/java/seedu/address/commons/util/JsonUtil.java @@ -37,7 +37,8 @@ public class JsonUtil { .setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY) .registerModule(new SimpleModule("SimpleModule") .addSerializer(Level.class, new ToStringSerializer()) - .addDeserializer(Level.class, new LevelDeserializer(Level.class))); + .addDeserializer(Level.class, new LevelDeserializer(Level.class)) + .addSerializer(Path.class, new ToStringSerializer())); static void serializeObjectToJsonFile(Path jsonFile, T objectToSerialize) throws IOException { FileUtil.writeToFile(jsonFile, toJsonString(objectToSerialize));