Open rpdeadly opened 5 years ago
I am not sure that violation.xml is even supported. @gsmet can of course shine all the necessary light here
I can see that the file it is hot reloaded https://github.com/quarkusio/quarkus/commit/45f875bd1c4b651f7a43617012a4a2c2ae786895#diff-b325242f07b81465b410fd3c1e40914aL78 but we are not trying to parse it anywhere. Let's wait for @gsmet to give his thoughts.
Right now, we only support annotations in Quarkus. It should probably be documented if it's not already.
I'm still unsure if we should implement more of the logic in Quarkus or if we should move all this discovery to HV somehow.
I found a partial work around. The rules specified in validation.xml are applied if i create a dummy class that extends the class I'm trying to validate. But validation cascading doesn't work.
<field name="owner">
<valid></valid>
<convert-group
from="demo.NewOrgCheck"
to="demo.NewOwnerCheck" />
<constraint
annotation="javax.validation.constraints.NotNull">
<message>Org owner must be specifed</message>
</constraint>
</field>
The fields within the owner class aren't validated.
A corresponding Hibernate Validator issue: https://hibernate.atlassian.net/browse/HV-2031
Hibernate's Validator implementation fails to catch any violation. I've got all of my validation rules specified in an XML ( because I do not have access to the source code ).
In my service I'm trying to validate the object
@Inject Validator validator; ... Set<ConstraintViolation> violations = validator.validate( myOrg );
if( ! violations.isEmpty() ) return false;
The violation set is always empty. I've tried my configuration using a standalone implementation of hibernate-validator and it works.