Skip to content

HV000271: Using @Valid on a container (java.util.List) is deprecated. You should apply the annotation on the type argument(s). #954

Description

@sapsucker58

When upgrading to spring boot 4.1, I encountered the warning that @Valid is deprecated on containers (https://docs.hibernate.org/validator/9.1/whats-new/en-US/html_single/#_jakarta_ee_11). I currently use annotations in my graphql schema as follows:

input WorkplaceInput
{
    employees: [EmployeeInput!]
    @annotate(name: "jakarta.validation.Valid")
}

input EmployeeInput
{
    name: String!
    @annotate(name: "jakarta.validation.constraints.Pattern", inputs: {regexp: "^[a-zA-Z]{2,64}$"})
}

Is there a way to achieve the same validation on employees without applying @Valid to the list of employees? Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions