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

Method level Constraint Annotations are not Validated after update to quarkus 3.9.3 #40071

Closed
kgorica opened this issue Apr 15, 2024 · 5 comments
Labels
area/hibernate-validator Hibernate Validator kind/bug Something isn't working triage/needs-reproducer We are waiting for a reproducer.

Comments

@kgorica
Copy link

kgorica commented Apr 15, 2024

Describe the bug

I have an POJO

public class MyModel {
    @RestQuery @NotNull
    private String testStr;
    @RestQuery
    private String value1;
    @RestQuery
    private String value2;

    @AssertTrue(message = "Values are invalid")
    public boolean isValid() {
        return value1 != null || value2 != null;
    }
}

and then expose an endpoint:

   @GET
    @Produces({MediaType.APPLICATION_JSON})
    @Consumes({MediaType.APPLICATION_JSON})
    public RestResponse<Smthing> get(@BeanParam @Valid MyModel model) {
        //dosmth
    }

Validation is fired and works on field-level validation testStr but does not validate @AssertTrue on method level.
It worked fine on quarkus 3.9.1 if I remember correctly but after latest update it doesn't work.

Expected behavior

ValidationException to be thrown

Actual behavior

nothing, validation is marked as valid

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

openjdk 17.0.8 2023-07-18 OpenJDK Runtime Environment OpenLogic-OpenJDK (build 17.0.8+7-adhoc..jdk17u) OpenJDK 64-Bit Server VM OpenLogic-OpenJDK (build 17.0.8+7-adhoc..jdk17u, mixed mode, sharing)

Quarkus version or git rev

3.9.3

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

apache-maven-3.9.6 Java version: 17.0.8, vendor: OpenLogic, runtime: C:\Program Files\OpenLogic\jdk-17.0.8.7-hotspot Default locale: en_US, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional information

No response

@kgorica kgorica added the kind/bug Something isn't working label Apr 15, 2024
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Apr 15, 2024
@gsmet
Copy link
Member

gsmet commented Apr 15, 2024

I'm not convinced it worked on private methods.

If you can come up with a reproducer that worked with 3.9.1 and fails with 3.9.3, I'm interested.

@gsmet gsmet added area/hibernate-validator Hibernate Validator and removed triage/needs-triage labels Apr 15, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 15, 2024

/cc @yrodiere (hibernate-validator)

@gsmet gsmet added triage/backport triage/needs-reproducer We are waiting for a reproducer. and removed triage/backport labels Apr 15, 2024
@geoand geoand removed the env/windows Impacts Windows machines label Apr 15, 2024
@quarkusio quarkusio deleted a comment from quarkus-bot bot Apr 15, 2024
@kgorica
Copy link
Author

kgorica commented Apr 23, 2024

I'm not convinced it worked on private methods.

If you can come up with a reproducer that worked with 3.9.1 and fails with 3.9.3, I'm interested.

I'm trying both private and public method, same issue.

@yrodiere
Copy link
Member

yrodiere commented May 2, 2024

@kgorica Alright, can you please provide a reproducer -- a small project that demonstrates the error, so we can debug it?

@geoand
Copy link
Contributor

geoand commented May 17, 2024

Closing for a lack of a reproducer

@geoand geoand closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
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 triage/needs-reproducer We are waiting for a reproducer.
Projects
None yet
Development

No branches or pull requests

4 participants