Skip to content

Hibernate validator does not work with extending interfaces #13470

@Meemaw

Description

@Meemaw

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions