Skip to content

panache-data-rest and beanValidation with @AssertTrue and Boolean types #48055

Answered by marko-bekhta
akil-rails asked this question in Q&A
Discussion options

You must be logged in to vote

yes ... the big boolean is considered an object and hence it is expected that a getXXX is used for its getter, and isXXX is only applicable if the return type is a primitive boolean:

https://github.com/hibernate/hibernate-validator/blob/4b8969ca22bc6df00173994168a31f57c88249b8/engine/src/main/java/org/hibernate/validator/internal/properties/DefaultGetterPropertySelectionStrategy.java#L81-L102 ( see also the javadoc above this method)

so in other words, Hibernate Validator does not consider Boolean isValid() to be a getter method and ignores it when it comes to validating bean properties.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@FroMage
Comment options

FroMage May 26, 2025
Collaborator

@gsmet
Comment options

@marko-bekhta
Comment options

Answer selected by akil-rails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
4 participants