From 1e70822adb9b7bf334f313036b64565b8bf2a07a Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Mon, 9 Jan 2023 12:44:23 +0100 Subject: [PATCH] Fix javax with jakarta references in documentation --- .../src/docs/asciidoc/features/external-config.adoc | 2 +- .../spring-boot-docs/src/docs/asciidoc/io/validation.adoc | 4 ++-- .../spring-boot-docs/src/docs/asciidoc/messaging/jms.adoc | 5 +++-- .../src/docs/asciidoc/messaging/websockets.adoc | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc index d56ef3daf9..872a0849cb 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/external-config.adoc @@ -1137,7 +1137,7 @@ Doing so gives a transparent upgrade path while supporting a much richer format. [[features.external-config.typesafe-configuration-properties.validation]] ==== @ConfigurationProperties Validation Spring Boot attempts to validate `@ConfigurationProperties` classes whenever they are annotated with Spring's `@Validated` annotation. -You can use JSR-303 `javax.validation` constraint annotations directly on your configuration class. +You can use JSR-303 `jakarta.validation` constraint annotations directly on your configuration class. To do so, ensure that a compliant JSR-303 implementation is on your classpath and then add constraint annotations to your fields, as shown in the following example: include::code:MyProperties[] diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/validation.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/validation.adoc index be6929a7bd..092d48870f 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/validation.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/validation.adoc @@ -1,7 +1,7 @@ [[io.validation]] == Validation The method validation feature supported by Bean Validation 1.1 is automatically enabled as long as a JSR-303 implementation (such as Hibernate validator) is on the classpath. -This lets bean methods be annotated with `javax.validation` constraints on their parameters and/or on their return value. +This lets bean methods be annotated with `jakarta.validation` constraints on their parameters and/or on their return value. Target classes with such annotated methods need to be annotated with the `@Validated` annotation at the type level for their methods to be searched for inline constraint annotations. For instance, the following service triggers the validation of the first argument, making sure its size is between 8 and 10: @@ -13,4 +13,4 @@ This allows you to use < - javax.websocket - javax.websocket-api + jakarta.websocket + jakarta.websocket-api ----