#1313 - Override Problem.withStatus in ExtendedProblem to preserve payload.
When you use the withStatus() method on an ExtendedProblem, it hands back a Problem, which drops the payload. This commit adds the same sort of override already provided for the other attributes in ExtendedProblem.
This commit is contained in:
@@ -195,6 +195,15 @@ public class Problem {
|
||||
return new ExtendedProblem<>(getType(), title, getStatus(), getDetail(), getInstance(), extendedProperties);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.mediatype.problem.Problem#withStatus(org.springframework.http.HttpStatus)
|
||||
*/
|
||||
@Override
|
||||
public ExtendedProblem<T> withStatus(@Nullable HttpStatus status) {
|
||||
return new ExtendedProblem<>(getType(), getTitle(), status, getDetail(), getInstance(), extendedProperties);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.hateoas.mediatype.problem.Problem#withDetail(java.lang.String)
|
||||
|
||||
Reference in New Issue
Block a user