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

Not passing through Bean Validation constraints on containers #1497

Open
KangoV opened this issue Dec 2, 2023 · 0 comments
Open

Not passing through Bean Validation constraints on containers #1497

KangoV opened this issue Dec 2, 2023 · 0 comments

Comments

@KangoV
Copy link

KangoV commented Dec 2, 2023

Bean Validation 2.0 added the ability to have constraints on containers:

  • List
  • Set
  • Map
  • Optional

I think there may be some others though

I have passAnnotations = { Introspected.class } set as a style (it seems this is needed).

I have the following attribute:

@JsonProperty("roles")
Set<@Size(min=2) String> getRoles();

The constraint will not get added and ends up as:

@JsonProperty("roles")
@Override
public Set<String> getRoles() {
    return roles;
}

In the implementation.

I did read somewhere (on here) that this is a compiler/annotation processing problem. Not sure if it still is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant