Browse Source

Update docs content types for ProblemDetail

Closes gh-36192
6.2.x
rstoyanchev 5 days ago
parent
commit
bc5e395a42
  1. 6
      framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc
  2. 6
      framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc

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

@ -32,9 +32,9 @@ any `@RequestMapping` method to render an RFC 9457 response. This is processed a
- The `status` property of `ProblemDetail` determines the HTTP status. - The `status` property of `ProblemDetail` determines the HTTP status.
- The `instance` property of `ProblemDetail` is set from the current URL path, if not - The `instance` property of `ProblemDetail` is set from the current URL path, if not
already set. already set.
- For content negotiation, the Jackson `HttpMessageConverter` prefers - The Jackson JSON and XML message converters use "application/problem+json" or
"application/problem+json" over "application/json" when rendering a `ProblemDetail`, "application/problem+xml" respectively as the producible media types for `ProblemDetail`
and also falls back on it if no compatible media type is found. to ensure they are favoured for content negotiation.
To enable RFC 9457 responses for Spring WebFlux exceptions and for any To enable RFC 9457 responses for Spring WebFlux exceptions and for any
`ErrorResponseException`, extend `ResponseEntityExceptionHandler` and declare it as an `ErrorResponseException`, extend `ResponseEntityExceptionHandler` and declare it as an

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

@ -32,9 +32,9 @@ any `@RequestMapping` method to render an RFC 9457 response. This is processed a
- The `status` property of `ProblemDetail` determines the HTTP status. - The `status` property of `ProblemDetail` determines the HTTP status.
- The `instance` property of `ProblemDetail` is set from the current URL path, if not - The `instance` property of `ProblemDetail` is set from the current URL path, if not
already set. already set.
- For content negotiation, the Jackson `HttpMessageConverter` prefers 0- The Jackson JSON and XML codecs use "application/problem+json" or
"application/problem+json" over "application/json" when rendering a `ProblemDetail`, "application/problem+xml" respectively as the producible media types for `ProblemDetail`
and also falls back on it if no compatible media type is found. to ensure they are favoured for content negotiation.
To enable RFC 9457 responses for Spring MVC exceptions and for any To enable RFC 9457 responses for Spring MVC exceptions and for any
`ErrorResponseException`, extend `ResponseEntityExceptionHandler` and declare it as an `ErrorResponseException`, extend `ResponseEntityExceptionHandler` and declare it as an

Loading…
Cancel
Save