-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
java validation errors in graphql #23838
Comments
/cc @jmartisk, @phillip-kruger |
@gsmet could you have a look? To me it looks like a HV issue, not specific to GraphQL |
@raoua-eng it would help if you could put together a full reproducer (i.e. a Maven project containing everything needed to reproduce the issue). Thanks! |
@gsmet Feel free to use a reproducer I made for this issue: https://github.com/raoua-eng/Quarkus |
@gsmet do you think the issue is related to EL restrictions NONE, VARIABLES, BEAN_PROPERTIES(default), BEAN_METHODS ? |
Yes exactly. The default allows you to use bean properties but not call methods on beans. Thus why you cannot use the I wonder if we should have some sort of allow list allowing some of the harmless but very useful methods. @yrodiere any opinion on that? It makes things a bit blurry though. Also, for now, you cannot configure the default expression language level in Quarkus, we need to fix it. |
Meh. Not a fan of things that needs to be updated continuously, and that list probably would. Maybe if it can be customized by users somehow... Regardless, I think the main problem here is that users are not warned that their attempt to call a method is being ignored, and they are not provided with a helpful message telling them what to change in their application to make it work. But I suppose we don't have a way to warn something every time a method call is ignored? It doesn't work that way?
👍 |
Thanks and I hope it will be fixed soon. |
…evel I only exposed the constraint one and not the custom violation one as I think it is bad practice to globally change the custom violation one. Fix quarkusio#23838
I created a PR for that here: #23877 |
…evel I only exposed the constraint one and not the custom violation one as I think it is bad practice to globally change the custom violation one. Fix quarkusio#23838
…evel I only exposed the constraint one and not the custom violation one as I think it is bad practice to globally change the custom violation one. Fix quarkusio#23838
…evel I only exposed the constraint one and not the custom violation one as I think it is bad practice to globally change the custom violation one. Fix quarkusio#23838 (cherry picked from commit 780d683)
2.7.3.Final has been released and you can now configure the behavior with: quarkus.hibernate-validator.expression-language.constraint-expression-feature-level=bean-methods |
Great :) thank you for your support |
Describe the bug
I'm experiensing validation in GraphQL inputs with the Java Bean Validation API and I tried to customize message errors by using the expression language (EL) as below :
Then in the graphql playground if we added a wrong civility with an invalid charachter long, here must be at least 5 we get this message error :
Expected behavior
In the message error should be :
Actual behavior
How to Reproduce?
As a reproducer we start by the GraphQL input
then the mutation code:
Lastly the query in the graphql playground is
Output of
uname -a
orver
No response
Output of
java -version
"1.8.0_265"
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.5.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: