Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a blurb about not supporting validation.xml in Quarkus #30548

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/src/main/asciidoc/validation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,19 @@ In this case, it means `Book.id` must be `null` and `Book.title` must not be bla
will be validated for the `book` parameter of the `put` method.
In this case, it means `Book.id` must not be `null` and `Book.title` must not be blank.

== Limitations

=== META-INF/validation.xml

Configuring the `ValidatorFactory` using a `META-INF/validation.xml` file is *NOT* supported in Quarkus.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it will just be ignored silently?

Do you think it would be a good idea to fail on startup if that file exists, and provide a configuration option quarkus.hibernate-validator.validation-xml.ignore, like we did for persistence.xml?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno. Might be a good idea but it might also break some expectations. I'll merge that one and we can iterate later if we think it's the way to go.


At the moment, Hibernate Validator does not expose an API to extract the information from this file
so that we could register the appropriate classes for reflection.

To configure the `ValidatorFactory`, use the exposed configuration properties and the CDI integration.

Consequently, the only way to define constraints in Quarkus is by annotating your classes.

[[configuration-reference]]
== Hibernate Validator Configuration Reference

Expand Down