From 4bc9f6845100819eb5a47e80a6a6076e985f5cd6 Mon Sep 17 00:00:00 2001 From: rstoyanchev Date: Wed, 28 Jan 2026 09:53:13 +0000 Subject: [PATCH] Update docs content types for ProblemDetail Closes gh-36192 --- .../modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc | 6 +++--- .../ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc b/framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc index e0ddefb1221..715de8eef24 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/ann-rest-exceptions.adoc +++ b/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 `instance` property of `ProblemDetail` is set from the current URL path, if not already set. -- For content negotiation, the Jackson `HttpMessageConverter` prefers -"application/problem+json" over "application/json" when rendering a `ProblemDetail`, -and also falls back on it if no compatible media type is found. +- The Jackson JSON and XML message converters use "application/problem+json" or +"application/problem+xml" respectively as the producible media types for `ProblemDetail` +to ensure they are favoured for content negotiation. To enable RFC 9457 responses for Spring WebFlux exceptions and for any `ErrorResponseException`, extend `ResponseEntityExceptionHandler` and declare it as an diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc index 865ee88a676..149c1557f2a 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-ann-rest-exceptions.adoc +++ b/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 `instance` property of `ProblemDetail` is set from the current URL path, if not already set. -- For content negotiation, the Jackson `HttpMessageConverter` prefers -"application/problem+json" over "application/json" when rendering a `ProblemDetail`, -and also falls back on it if no compatible media type is found. +0- The Jackson JSON and XML codecs use "application/problem+json" or +"application/problem+xml" respectively as the producible media types for `ProblemDetail` +to ensure they are favoured for content negotiation. To enable RFC 9457 responses for Spring MVC exceptions and for any `ErrorResponseException`, extend `ResponseEntityExceptionHandler` and declare it as an