Skip to content

Commit c3b814d

Browse files
authored
Merge pull request #1321 from marcelstoer/patch-1
Add note about import order
2 parents 62f9284 + 1bac53a commit c3b814d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/doc/hbv/hbv.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ Bean validation via [Hibernate Validator](hibernate.org/validator).
3535
});
3636
}
3737
```
38+
### in combination with JSON parser
39+
Jooby does not have a validation API or a validation API for HTTP bodies. Instead, this validator _wraps_ existing body parsers as they simply return the first deserialized object. Consequently, this module must be imported _before_ you import any parser!
40+
If you were to use the [Jackson JSON parser module](../jackson/jackson.md) it would look like this:
41+
42+
```java
43+
{
44+
// must be imported before any body parser
45+
use(new Hbv());
46+
use(new Jackson());
47+
48+
// routes go here
49+
}
50+
```
3851

3952
## automatic validations of HTTP params and body
4053

0 commit comments

Comments
 (0)