Код: Выделить всё
@Getter
@ToString
@RequiredArgsConstructor(onConstructor_ = {@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)})
private static class RestErrorObject {
private final String error; // optional
private final String message; // optional
private final String path; // optional
private final String status; // optional
private final String timestamp; // optional
}
Код: Выделить всё
@Getter
@ToString
private static class RestErrorObject {
private final String error; // optional
private final String message; // optional
private final String path; // optional
private final String status; // optional
private final String timestamp; // optional
@JsonCreator
RestErrorObject(@JsonProperty("error") String error, @JsonProperty("message") String message,
@JsonProperty("path") String path, @JsonProperty("status") String status,
@JsonProperty("timestamp") String timestamp) {
this.error = error;
this.message = message;
this.path = path;
this.status = status;
this.timestamp = timestamp;
}
}
Подробнее здесь: https://stackoverflow.com/questions/581 ... soncreator