Skip to content

Create one message if length is too short and a different message if too long #360

@Pi-Cla

Description

@Pi-Cla

When I tried to update past 0.16 I now have a "Duplicate field length" bug when I try to use duplicate fields like so:

#[validate(
        length(min = 1, message = "cannot be empty"),
        length(max = 32, message = "must be <= 32 characters")
    )]
    pub name: String,

where I intentionally use two different length checks to create two different messages.

Is there a way to still create two different messages or will I have to just combine them into one message like: "string was empty or had more than 32 characters"?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions