diff --git a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-requestmapping.adoc b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-requestmapping.adoc index 7b12fe54e1f..8e726a1b791 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-requestmapping.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/controller/ann-requestmapping.adoc @@ -393,9 +393,9 @@ is used to map requests. Once API versioning is enabled, you can begin to map requests with versions. The `@RequestMapping` `version` attribute supports the following: -- No value -- matches any version, unless the request is superseded by a more specific version match. - Fixed version ("1.2") -- matches the given version only - Baseline version ("1.2+") -- matches the given version and above +- No value -- matches any version, but is superseded by a more specific version match If multiple controller methods have a version less than or equal to the request version, the highest of those, and closest to the request version, is the one considered, @@ -454,6 +454,11 @@ A request with version `"1.6"` does not have a match. (1) and (3) do match, but superseded by (4), which allows only a strict match, and therefore does not match. In this scenario, a `NotAcceptableApiVersionException` results in a 400 response. +Controller methods without a version are intended to support clients created before a +versioned alternative was introduced. Therefore, even though an unversioned controller +method is considered a match for any version, it is in fact given the lowest priority, +and is effectively superseded by any alternative controller method with a version. + NOTE: The above assumes the request version is a xref:web/webflux/config.adoc#webflux-config-api-version["supported" version], or otherwise it would fail. diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-requestmapping.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-requestmapping.adoc index 8890fa250d2..988ae3fc8ea 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-requestmapping.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-controller/ann-requestmapping.adoc @@ -424,9 +424,9 @@ is used to map requests. Once API versioning is enabled, you can begin to map requests with versions. The `@RequestMapping` `version` attribute supports the following: -- No value -- matches any version, unless the request is superseded by a more specific version match. - Fixed version ("1.2") -- matches the given version only - Baseline version ("1.2+") -- matches the given version and above +- No value -- matches any version, but is superseded by a more specific version match If multiple controller methods have a version less than or equal to the request version, the highest of those, and closest to the request version, is the one considered, @@ -485,6 +485,11 @@ A request with version `"1.6"` does not have a match. (1) and (3) do match, but superseded by (4), which allows only a strict match, and therefore does not match. In this scenario, a `NotAcceptableApiVersionException` results in a 400 response. +Controller methods without a version are intended to support clients created before a +versioned alternative was introduced. Therefore, even though an unversioned controller +method is considered a match for any version, it is in fact given the lowest priority, +and is effectively superseded by any alternative controller method with a version. + NOTE: The above assumes the request version is a xref:web/webmvc/mvc-config/api-version.adoc["supported" version], or otherwise it would fail.