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

Class Contraint Validator on configuration using interfaces doesn't work #22915

Closed
sclorng opened this issue Jan 14, 2022 · 2 comments · Fixed by #27067
Closed

Class Contraint Validator on configuration using interfaces doesn't work #22915

sclorng opened this issue Jan 14, 2022 · 2 comments · Fixed by #27067
Assignees
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@sclorng
Copy link

sclorng commented Jan 14, 2022

Describe the bug

Following the work on #15081 class constraint are not called but contraint on properties does.

Expected behavior

Given

@ConfigMapping(prefix = "foo")
@CustomFalse
public interface TestConfig {
}
@Target({ TYPE, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Constraint(validatedBy = { CustomFalseValidator.class })
@Documented
public @interface CustomFalse {
    String message() default "nothing you can do";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };
}
public class CustomFalseValidator implements ConstraintValidator<CustomFalse , TestConfig> {

    @Override
    public boolean isValid(TestConfigconfig, ConstraintValidatorContext context) {
        return false;
    }
}

Validation should failed.

Actual behavior

Validation pass

How to Reproduce?

No response

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.6.2

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

No response

Additional information

No response

@sclorng sclorng added the kind/bug Something isn't working label Jan 14, 2022
@famod famod added area/hibernate-validator Hibernate Validator and removed triage/needs-triage labels Jan 15, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 15, 2022

/cc @gsmet, @yrodiere

@geoand
Copy link
Contributor

geoand commented May 17, 2022

Is this still an issue with Quarkus 2.9.0.Final?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants