0%

fasterxml jackson无法实例化非静态内部类

com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of gy.finolo.Outer$Inner (although at least one Creator exists): can only instantiate non-static inner class by using default, no-argument constructor

fasterxml无法实例化非静态内部类。把内部类改为 static 的静态类就可以了。

1
2
3
4
5
6
7
8
9
10
@Data
public class Outer {

private Inner inner;

@Data
public static class Inner {

}
}