Skip to content

Make type in ProblemDetail nullable #35294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,14 @@ protected ProblemDetail() {
* <p>By default, this is {@link #BLANK_TYPE}.
* @param type the problem type
*/
public void setType(URI type) {
Assert.notNull(type, "'type' is required");
public void setType(@Nullable URI type) {
this.type = type;
}

/**
* Return the configured {@link #setType(URI) problem type}.
*/
public URI getType() {
public @Nullable URI getType() {
return this.type;
}

Expand Down Expand Up @@ -245,7 +244,7 @@ public void setProperties(@Nullable Map<String, Object> properties) {
@Override
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof ProblemDetail that &&
getType().equals(that.getType()) &&
ObjectUtils.nullSafeEquals(getType(), that.getType()) &&
ObjectUtils.nullSafeEquals(getTitle(), that.getTitle()) &&
this.status == that.status &&
ObjectUtils.nullSafeEquals(this.detail, that.detail) &&
Expand Down