Skip to content

Commit 89ce63f

Browse files
committed
Replace RFC7807 by RFC9457 in documentation
This commit updates all references to RFC7807 by RFC9457 since the former is now obsolete. Closes gh-32806
1 parent 7536980 commit 89ce63f

File tree

14 files changed

+32
-32
lines changed

14 files changed

+32
-32
lines changed

framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
A common requirement for REST services is to include details in the body of error
77
responses. The Spring Framework supports the "Problem Details for HTTP APIs"
8-
specification, {rfc-site}/rfc7807.html[RFC 7807].
8+
specification, {rfc-site}/rfc9457.html[RFC 9457].
99

1010
The following are the main abstractions for this support:
1111

12-
- `ProblemDetail` -- representation for an RFC 7807 problem detail; a simple container
12+
- `ProblemDetail` -- representation for an RFC 9457 problem detail; a simple container
1313
for both standard fields defined in the spec, and for non-standard ones.
1414
- `ErrorResponse` -- contract to expose HTTP error response details including HTTP
15-
status, response headers, and a body in the format of RFC 7807; this allows exceptions to
15+
status, response headers, and a body in the format of RFC 9457; this allows exceptions to
1616
encapsulate and expose the details of how they map to an HTTP response. All Spring WebFlux
1717
exceptions implement this.
1818
- `ErrorResponseException` -- basic `ErrorResponse` implementation that others
@@ -28,7 +28,7 @@ and any `ErrorResponseException`, and renders an error response with a body.
2828
[.small]#xref:web/webmvc/mvc-ann-rest-exceptions.adoc#mvc-ann-rest-exceptions-render[See equivalent in the Servlet stack]#
2929

3030
You can return `ProblemDetail` or `ErrorResponse` from any `@ExceptionHandler` or from
31-
any `@RequestMapping` method to render an RFC 7807 response. This is processed as follows:
31+
any `@RequestMapping` method to render an RFC 9457 response. This is processed as follows:
3232

3333
- The `status` property of `ProblemDetail` determines the HTTP status.
3434
- The `instance` property of `ProblemDetail` is set from the current URL path, if not
@@ -37,7 +37,7 @@ already set.
3737
"application/problem+json" over "application/json" when rendering a `ProblemDetail`,
3838
and also falls back on it if no compatible media type is found.
3939

40-
To enable RFC 7807 responses for Spring WebFlux exceptions and for any
40+
To enable RFC 9457 responses for Spring WebFlux exceptions and for any
4141
`ErrorResponseException`, extend `ResponseEntityExceptionHandler` and declare it as an
4242
xref:web/webflux/controller/ann-advice.adoc[@ControllerAdvice] in Spring configuration. The handler
4343
has an `@ExceptionHandler` method that handles any `ErrorResponse` exception, which
@@ -50,7 +50,7 @@ use a protected method to map any exception to a `ProblemDetail`.
5050
== Non-Standard Fields
5151
[.small]#xref:web/webmvc/mvc-ann-rest-exceptions.adoc#mvc-ann-rest-exceptions-non-standard[See equivalent in the Servlet stack]#
5252

53-
You can extend an RFC 7807 response with non-standard fields in one of two ways.
53+
You can extend an RFC 9457 response with non-standard fields in one of two ways.
5454

5555
One, insert into the "properties" `Map` of `ProblemDetail`. When using the Jackson
5656
library, the Spring Framework registers `ProblemDetailJacksonMixin` that ensures this

framework-docs/modules/ROOT/pages/web/webflux/controller/ann-methods/return-types.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ generally supported for all return values.
2424
| For returning a response with headers and no body.
2525

2626
| `ErrorResponse`
27-
| To render an RFC 7807 error response with details in the body,
27+
| To render an RFC 9457 error response with details in the body,
2828
see xref:web/webflux/ann-rest-exceptions.adoc[Error Responses]
2929

3030
| `ProblemDetail`
31-
| To render an RFC 7807 error response with details in the body,
31+
| To render an RFC 9457 error response with details in the body,
3232
see xref:web/webflux/ann-rest-exceptions.adoc[Error Responses]
3333

3434
| `String`

framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
A common requirement for REST services is to include details in the body of error
77
responses. The Spring Framework supports the "Problem Details for HTTP APIs"
8-
specification, {rfc-site}/rfc7807[RFC 7807].
8+
specification, {rfc-site}/rfc9457[RFC 9457].
99

1010
The following are the main abstractions for this support:
1111

12-
- `ProblemDetail` -- representation for an RFC 7807 problem detail; a simple container
12+
- `ProblemDetail` -- representation for an RFC 9457 problem detail; a simple container
1313
for both standard fields defined in the spec, and for non-standard ones.
1414
- `ErrorResponse` -- contract to expose HTTP error response details including HTTP
15-
status, response headers, and a body in the format of RFC 7807; this allows exceptions to
15+
status, response headers, and a body in the format of RFC 9457; this allows exceptions to
1616
encapsulate and expose the details of how they map to an HTTP response. All Spring MVC
1717
exceptions implement this.
1818
- `ErrorResponseException` -- basic `ErrorResponse` implementation that others
@@ -28,7 +28,7 @@ and any `ErrorResponseException`, and renders an error response with a body.
2828
[.small]#xref:web/webflux/ann-rest-exceptions.adoc#webflux-ann-rest-exceptions-render[See equivalent in the Reactive stack]#
2929

3030
You can return `ProblemDetail` or `ErrorResponse` from any `@ExceptionHandler` or from
31-
any `@RequestMapping` method to render an RFC 7807 response. This is processed as follows:
31+
any `@RequestMapping` method to render an RFC 9457 response. This is processed as follows:
3232

3333
- The `status` property of `ProblemDetail` determines the HTTP status.
3434
- The `instance` property of `ProblemDetail` is set from the current URL path, if not
@@ -37,7 +37,7 @@ already set.
3737
"application/problem+json" over "application/json" when rendering a `ProblemDetail`,
3838
and also falls back on it if no compatible media type is found.
3939

40-
To enable RFC 7807 responses for Spring WebFlux exceptions and for any
40+
To enable RFC 9457 responses for Spring WebFlux exceptions and for any
4141
`ErrorResponseException`, extend `ResponseEntityExceptionHandler` and declare it as an
4242
xref:web/webmvc/mvc-controller/ann-advice.adoc[@ControllerAdvice] in Spring configuration. The handler
4343
has an `@ExceptionHandler` method that handles any `ErrorResponse` exception, which
@@ -50,7 +50,7 @@ use a protected method to map any exception to a `ProblemDetail`.
5050
== Non-Standard Fields
5151
[.small]#xref:web/webflux/ann-rest-exceptions.adoc#webflux-ann-rest-exceptions-non-standard[See equivalent in the Reactive stack]#
5252

53-
You can extend an RFC 7807 response with non-standard fields in one of two ways.
53+
You can extend an RFC 9457 response with non-standard fields in one of two ways.
5454

5555
One, insert into the "properties" `Map` of `ProblemDetail`. When using the Jackson
5656
library, the Spring Framework registers `ProblemDetailJacksonMixin` that ensures this

framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-exceptionhandler.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ level, xref:web/webmvc/mvc-servlet/exceptionhandlers.adoc[HandlerExceptionResolv
228228
See xref:web/webmvc/mvc-controller/ann-methods/responseentity.adoc[ResponseEntity].
229229

230230
| `ErrorResponse`
231-
| To render an RFC 7807 error response with details in the body,
231+
| To render an RFC 9457 error response with details in the body,
232232
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
233233

234234
| `ProblemDetail`
235-
| To render an RFC 7807 error response with details in the body,
235+
| To render an RFC 9457 error response with details in the body,
236236
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
237237

238238
| `String`

framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-methods/return-types.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ supported for all return values.
2323
| For returning a response with headers and no body.
2424

2525
| `ErrorResponse`
26-
| To render an RFC 7807 error response with details in the body,
26+
| To render an RFC 9457 error response with details in the body,
2727
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
2828

2929
| `ProblemDetail`
30-
| To render an RFC 7807 error response with details in the body,
30+
| To render an RFC 9457 error response with details in the body,
3131
see xref:web/webmvc/mvc-ann-rest-exceptions.adoc[Error Responses]
3232

3333
| `String`

spring-web/src/main/java/org/springframework/http/MediaType.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public class MediaType extends MimeType implements Serializable {
184184
/**
185185
* Public constant media type for {@code application/problem+json}.
186186
* @since 5.0
187-
* @see <a href="https://tools.ietf.org/html/rfc7807#section-6.1">
187+
* @see <a href="https://www.iana.org/assignments/media-types/application/problem+json">
188188
* Problem Details for HTTP APIs, 6.1. application/problem+json</a>
189189
*/
190190
public static final MediaType APPLICATION_PROBLEM_JSON;
@@ -198,7 +198,7 @@ public class MediaType extends MimeType implements Serializable {
198198
/**
199199
* Public constant media type for {@code application/problem+json}.
200200
* @since 5.0
201-
* @see <a href="https://tools.ietf.org/html/rfc7807#section-6.1">
201+
* @see <a href="https://www.iana.org/assignments/media-types/application/problem+json">
202202
* Problem Details for HTTP APIs, 6.1. application/problem+json</a>
203203
* @deprecated as of 5.2 in favor of {@link #APPLICATION_PROBLEM_JSON}
204204
* since major browsers like Chrome
@@ -224,7 +224,7 @@ public class MediaType extends MimeType implements Serializable {
224224
/**
225225
* Public constant media type for {@code application/problem+xml}.
226226
* @since 5.0
227-
* @see <a href="https://tools.ietf.org/html/rfc7807#section-6.2">
227+
* @see <a href="https://www.iana.org/assignments/media-types/application/problem+xml">
228228
* Problem Details for HTTP APIs, 6.2. application/problem+xml</a>
229229
*/
230230
public static final MediaType APPLICATION_PROBLEM_XML;

spring-web/src/main/java/org/springframework/http/ProblemDetail.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.springframework.util.ObjectUtils;
2727

2828
/**
29-
* Representation for an RFC 7807 problem detail. Includes spec-defined
29+
* Representation for an RFC 9457 problem detail. Includes spec-defined
3030
* properties, and a {@link #getProperties() properties} map for additional,
3131
* non-standard properties.
3232
*
@@ -45,7 +45,7 @@
4545
* @author Rossen Stoyanchev
4646
* @author Juergen Hoeller
4747
* @since 6.0
48-
* @see <a href="https://datatracker.ietf.org/doc/html/rfc7807">RFC 7807</a>
48+
* @see <a href="https://datatracker.ietf.org/doc/html/rfc9457">RFC 9457</a>
4949
* @see org.springframework.web.ErrorResponse
5050
* @see org.springframework.web.ErrorResponseException
5151
*/

spring-web/src/main/java/org/springframework/web/ErrorResponse.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import org.springframework.lang.Nullable;
2828

2929
/**
30-
* Representation of a complete RFC 7807 error response including status,
31-
* headers, and an RFC 7807 formatted {@link ProblemDetail} body. Allows any
30+
* Representation of a complete RFC 9457 error response including status,
31+
* headers, and an RFC 9457 formatted {@link ProblemDetail} body. Allows any
3232
* exception to expose HTTP error response information.
3333
*
3434
* <p>{@link ErrorResponseException} is a default implementation of this
@@ -58,7 +58,7 @@ default HttpHeaders getHeaders() {
5858
}
5959

6060
/**
61-
* Return the body for the response, formatted as an RFC 7807
61+
* Return the body for the response, formatted as an RFC 9457
6262
* {@link ProblemDetail} whose {@link ProblemDetail#getStatus() status}
6363
* should match the response status.
6464
*/

spring-web/src/main/java/org/springframework/web/ErrorResponseException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/**
2828
* {@link RuntimeException} that implements {@link ErrorResponse} to expose
29-
* an HTTP status, response headers, and a body formatted as an RFC 7807
29+
* an HTTP status, response headers, and a body formatted as an RFC 9457
3030
* {@link ProblemDetail}.
3131
*
3232
* <p>The exception can be used as is, or it can be extended as a more specific

spring-web/src/main/java/org/springframework/web/multipart/support/MissingServletRequestPartException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public HttpStatusCode getStatusCode() {
7575
}
7676

7777
/**
78-
* Return the body for the response, formatted as an RFC 7807
78+
* Return the body for the response, formatted as an RFC 9457
7979
* {@link ProblemDetail} whose {@link ProblemDetail#getStatus() status}
8080
* should match the response status.
8181
*/

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ protected Mono<Void> writeBody(@Nullable Object body, MethodParameter bodyParame
175175
throw ex;
176176
}
177177

178-
// For ProblemDetail, fall back on RFC 7807 format
178+
// For ProblemDetail, fall back on RFC 9457 format
179179
if (bestMediaType == null && ProblemDetail.class.isAssignableFrom(elementType.toClass())) {
180180
bestMediaType = selectMediaType(exchange, () -> getMediaTypesFor(elementType), this.problemMediaTypes);
181181
}

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ResponseEntityExceptionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
/**
5151
* A class with an {@code @ExceptionHandler} method that handles all Spring
5252
* WebFlux raised exceptions by returning a {@link ResponseEntity} with
53-
* RFC 7807 formatted error details in the body.
53+
* RFC 9457 formatted error details in the body.
5454
*
5555
* <p>Convenient as a base class of an {@link ControllerAdvice @ControllerAdvice}
5656
* for global exception handling in an application. Subclasses can override

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ protected <T> void writeWithMessageConverters(@Nullable T value, MethodParameter
243243
List<MediaType> compatibleMediaTypes = new ArrayList<>();
244244
determineCompatibleMediaTypes(acceptableTypes, producibleTypes, compatibleMediaTypes);
245245

246-
// For ProblemDetail, fall back on RFC 7807 format
246+
// For ProblemDetail, fall back on RFC 9457 format
247247
if (compatibleMediaTypes.isEmpty() && ProblemDetail.class.isAssignableFrom(valueType)) {
248248
determineCompatibleMediaTypes(this.problemMediaTypes, producibleTypes, compatibleMediaTypes);
249249
}

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
/**
6060
* A class with an {@code @ExceptionHandler} method that handles all Spring MVC
61-
* raised exceptions by returning a {@link ResponseEntity} with RFC 7807
61+
* raised exceptions by returning a {@link ResponseEntity} with RFC 9457
6262
* formatted error details in the body.
6363
*
6464
* <p>Convenient as a base class of an {@link ControllerAdvice @ControllerAdvice}

0 commit comments

Comments
 (0)