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

Validation annotation on generic type params apply to field #1057

Closed
MikeEdgar opened this issue Feb 15, 2022 · 0 comments · Fixed by #1058
Closed

Validation annotation on generic type params apply to field #1057

MikeEdgar opened this issue Feb 15, 2022 · 0 comments · Fixed by #1058
Labels
bug Something isn't working
Milestone

Comments

@MikeEdgar
Copy link
Member

Given the following bean,

class Bean {
   @jakarta.validation.constraints.NotEmpty
   List<@jakarta.validation.constraints.NotNull String> list;
}

the scanner gnerates the following schema with the list property identified as "nullable": false, but the @NotNull actually applies to the items.

"Bean" : {
  "required" : [ "list" ],
  "type" : "object",
  "properties" : {
    "list" : {
      "minItems" : 1,
      "type" : "array",
      "items" : {
        "type" : "string"
      },
      "nullable" : false
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant