Skip to content

Commit d712402

Browse files
committed
Javadoc on api Valid annotation
1 parent 3eea70b commit d712402

File tree

1 file changed

+12
-9
lines changed
  • http-api/src/main/java/io/avaje/http/api

1 file changed

+12
-9
lines changed

http-api/src/main/java/io/avaje/http/api/Valid.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@
99
import java.lang.annotation.Target;
1010

1111
/**
12-
*
13-
* Add @Valid annotation on a controller/method/BeanParam that we want bean validation to be included for.
14-
* When we do this controller methods that take a request payload will then have the request bean
15-
* (populated by JSON payload or form parameters) validated before it is passed to the controller
16-
* method.
17-
*
18-
* When trying to validate a @BeanParam bean, this will need to be placed on the BeanParam type
19-
12+
* Add {@code @Valid} annotation on a controller/method/BeanParam that we want bean validation to
13+
* be included for. When we do this controller methods that take a request payload will then have
14+
* the request bean (populated by JSON payload or form parameters) validated before it is passed
15+
* to the controller method.
16+
* <p>
17+
* When trying to validate a {@code @BeanParam} bean, this will need to be placed on the BeanParam type.
18+
* <p>
19+
* When using this annotation we need to provide an implementation of {@link Validator} to use.
20+
* <p>
21+
* Alternatively we can use the Jakarta {@code @Valid} along with a Jakarta validator implementation.
2022
*/
2123
@Retention(SOURCE)
2224
@Target({METHOD, TYPE, PARAMETER})
23-
public @interface Valid {}
25+
public @interface Valid {
26+
}

0 commit comments

Comments
 (0)