Skip to content

Commit 0efb8fe

Browse files
committed
Clarify scope for ConstraintValidators
Fix quarkusio#18763
1 parent 3807403 commit 0efb8fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/src/main/asciidoc/validation.adoc

+5-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,11 @@ You don't have to wire anything.
303303
====
304304
Obviously, for each listed type, you can declare only one bean.
305305
306-
These beans should be declared as `@ApplicationScoped`.
306+
Most of the time, these beans should be declared as `@ApplicationScoped`.
307+
308+
However, in the case of ``ConstraintValidator``s that are dependent of attributes of the constraint annotation
309+
(typically when implementing the `initialize(A constraintAnnotation)` method),
310+
use the `@Dependent` scope to make sure each annotation context has a separate instance of the `ConstraintValidator` bean.
307311
====
308312

309313
==== Constraint validators as beans

0 commit comments

Comments
 (0)