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

Quarkus 2.1.0.CR1: Hibernate Validator produces a warning when combined with Resteasy Reactive and Kotlin Coroutines #18783

Closed
mschorsch opened this issue Jul 18, 2021 · 2 comments · Fixed by #18798
Assignees
Milestone

Comments

@mschorsch
Copy link

mschorsch commented Jul 18, 2021

Describe the bug

The combination of Resteasy Reactive + Kotlin Coroutines + Hibernate Validator leads to the following warning at compile time:

[WARNING] [io.quarkus.hibernate.validator.deployment] Hibernate Validator does not support constraints on static methods yet. Constraints on org.acme.ReactiveGreetingResource#java.lang.Object hello$suspendImpl(org.acme.ReactiveGreetingResource name, java.lang.String $completion, kotlin.coroutines.Continuation) are ignored.

Expected behavior

No warning.

Actual behavior

No response

How to Reproduce?

  1. Create a new quarkus project with the dependencies: Resteasy Reactive + Kotlin Coroutines + Hibernate Validator
  2. Update Quarkus to 2.1.0.CR1
  3. Update Kotlin to 1.5.10
  4. Create a suspend function
import org.hibernate.validator.constraints.Length
import org.jboss.resteasy.reactive.RestPath
import javax.validation.constraints.NotNull
import javax.ws.rs.GET
import javax.ws.rs.Path
import javax.ws.rs.Produces
import javax.ws.rs.core.MediaType

@Path("/")
class ReactiveGreetingResource {

    @Path("{name}")
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    suspend fun hello(
        @RestPath("name") @NotNull @Length(max = 5) name: String,
    ) = "Hello RESTEasy Reactive"
}

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.1.0.CR1

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@mschorsch mschorsch added the kind/bug Something isn't working label Jul 18, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 18, 2021

@geoand geoand self-assigned this Jul 19, 2021
geoand added a commit to geoand/quarkus that referenced this issue Jul 19, 2021
This is now necessary because as of Kotlin 1.5, the compiler
copies annotations from the original method, to the synthetic
method it creates to support Kotlin coroutines

Fixes: quarkusio#18783
@geoand
Copy link
Contributor

geoand commented Jul 19, 2021

Thanks for reporting!

#18798 fixes the issue

gsmet added a commit that referenced this issue Jul 19, 2021
Ignore synthetic methods for purposes of bean validation
@quarkus-bot quarkus-bot bot added this to the 2.2 - main milestone Jul 19, 2021
@gsmet gsmet modified the milestones: 2.2 - main, 2.1.0.Final Jul 19, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 19, 2021
This is now necessary because as of Kotlin 1.5, the compiler
copies annotations from the original method, to the synthetic
method it creates to support Kotlin coroutines

Fixes: quarkusio#18783
(cherry picked from commit 55f7970)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants