Open famod opened 4 years ago
/cc @geoand /cc @gsmet
Can someone please provide me with the context of this one?
@geoand In #11506 I first did not check the annotation target kind which resulted in the following error for spring-web: https://github.com/quarkusio/quarkus/pull/11506#issuecomment-678022827
So it seems the spring-web extension is addind non-method-level jaxrs-annotations. Since hibernate validator is only checking for jaxrs method-level annotations, the question is whether we are missing something in hibernate-validator for spring-web.
PS: Welcome back, btw.
@geoand In #11506 I first did not check the annotation target kind which resulted in the following error for spring-web: #11506 (comment)
So it seems the spring-web extension is addind non-method-level jaxrs-annotations. Since hibernate validator is only checking for jaxrs method-level annotations, the question is whether we are missing something in hibernate-validator for spring-web.
Do you recall which annotation was causing the error?
PS: Welcome back, btw.
Thanks :)
Do you recall which annotation was causing the error?
No, but should be easy to reproduce. I'll add another comment later.
Printout of all non-method annotations in ExceptionHandlingTest
:
[INFO] Running io.quarkus.it.spring.web.ExceptionHandlingTest
@RequestMapping(value = ["/cache"])
@RequestMapping(value = ["/api"])
@RequestMapping(value = ["/exception"])
@RequestMapping(value = ["/greeting"])
@RequestMapping(value = ["/cache"])
@RequestMapping(value = ["/api"])
@RequestMapping(value = ["/exception"])
@RequestMapping(value = ["/greeting"])
Right, I saw that, so I guess it's my bad that I didn't ask the proper question:
What I don't understand is how come the test started failing now? What changed in the PR regarding annotation lookup?
The test started failing when I addedthe gathering of all methods with JAX-RS annotations in the entire Quarkus app. This is required to cover JAX-RS annotations in interfaces and superclasses.
At that early stage of the PR, a sanity check for the method kind was missing (asMethod()
was called without a pre-check).
OK :) Then it seems to me that there is nothing weird really going with Spring web, no?
Then it seems to me that there is nothing weird really going with Spring web, no?
As long as it's correct that @RequestMapping
is added to the Hibernate Validator processor as a "JAX-RS" annotation, the only question is whether the processor needs to cover class level as well (AFAICS: yes).
Yes to both :)
Description See https://github.com/quarkusio/quarkus/pull/11506/files#r474658572.
It should be checked whether the Hibernate Validator extension needs to be adjusted to consider class level "JAX-RS" annotations.