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

Hibernate validator does not work with extending interfaces #13470

Closed
Meemaw opened this issue Nov 25, 2020 · 3 comments · Fixed by #13529
Closed

Hibernate validator does not work with extending interfaces #13470

Meemaw opened this issue Nov 25, 2020 · 3 comments · Fixed by #13529
Assignees
Labels
area/hibernate-validator Hibernate Validator kind/bug Something isn't working
Milestone

Comments

@Meemaw
Copy link

Meemaw commented Nov 25, 2020

Describe the bug
quarkus-hibernate-validator does not work if class implements a resource interface that extends another interface.

public interface BookResource {

    String PATH = "/books";

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    String hello(@NotNull @QueryParam("name") String name);
}

@Path(ScienceBookResource.PATH)
public interface ScienceBookResource extends BookResource {

    String PATH = BookResource.PATH + "/science";
}

public class ScienceBookResourceImpl implements ScienceBookResource {

    @Override
    public String hello(String name) {
        return "Hello " + name;
    }
}

This used to work in Quarkus 1.6.2 but seems to be broken in some of the higher versions.

Expected behavior
quarkus-hibernate-validator should correctly validate even such resources.

Actual behavior
quarkus-hibernate-validator does not validate even such resources.

To Reproduce

git clone [email protected]:Meemaw/quarkus-validation-bug.git quarkus-reproducer-hibernate
cd quarkus-reproducer-hibernate
./mvnw quarkus:dev

Go to: http://localhost:8080/books/science

You will see: Hello null

What should happen: Validation error is thrown

Environment (please complete the following information):

  • Output of java -version: openjdk version "15.0.1" 2020-10-20
  • Quarkus version or git rev: 1.9.2 Final
@Meemaw Meemaw added the kind/bug Something isn't working label Nov 25, 2020
@ghost ghost added the area/hibernate-validator Hibernate Validator label Nov 25, 2020
@ghost
Copy link

ghost commented Nov 25, 2020

/cc @gsmet

@gsmet
Copy link
Member

gsmet commented Nov 27, 2020

Thanks for the detailed report and the reproducer.

I created #13529 to fix it.

@Meemaw
Copy link
Author

Meemaw commented Nov 28, 2020

Great, thanks @gsmet. Does this by any change also fixes #13029? It seems related.

@ghost ghost added this to the 1.11 - master milestone Nov 28, 2020
@gsmet gsmet modified the milestones: 1.11 - master, 1.10.2.Final Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-validator Hibernate Validator kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants