我可以反序列化此类的对象:
public class MyCoolClass {
public UUID uuid;
public String name;
public BookingPeriod openPeriod;
}
但是,一旦我扩展,它就会崩溃:
public class MyCoolClass extends TreeSet<Table> {
// ...same
}
TreeSet
与实现有关。
我发现的异常是:
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `test.MyCoolClass` out of START_OBJECT token
at [Source: (String)"{
"uuid": "e64c15af-adb0-437e-9fb8-7ad7e793b877",
"name": "Something-That-Can-Be-Opened",
"openPeriod": {
"from": "19:30",
"to": "23:30"
}
}"; line: 1, column: 1]
在不继承的情况下使用,程序将按预期运行。
“ 19:30” 反序列化为LocalTime