#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:
Greg L. Turnquist
2020-06-26 11:02:54 -05:00
parent f3198b7d79
commit 27fe7de1c9
3 changed files with 12 additions and 1 deletions

View File

@@ -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)