@ConstructorProperties
어노테이션을 생성자에 붙이면 해결된다.
class Employee {
private final int id;
private final String name;
@ConstructorProperties({"id", "name"})
public Employee(int id, String name) {
this.id = id;
this.name = name;
}
public int getEmpId() {
return id;
}
public String getEmpName() {
return name;
}
}
참고 자료
https://www.tutorialspoint.com/when-to-use-constructorproperties-annotation-with-jackson-in-java