Skip to content

When there are nested fields and multiple fields fail validation, the error messages lack a delimiter. #395

@ggmmai

Description

@ggmmai
#[derive(Debug, Deserialize, Validate)]
#[serde(rename_all = "camelCase")]
pub struct UserQueryParams {
    keyword: Option<String>,
    #[validate(nested)]
    #[serde(flatten)]
    pagination: PaginationParams,
}

#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Validate)]
pub struct PaginationParams {
    #[validate(range(min = 1, message = "Page must be greater than 0."))]
    pub page: u64,
    #[validate(range(min = 1, max = 100, message = "The page size must be between 1 and 100."))]
    pub size: u64,
}

When there are nested fields and multiple fields fail validation, the error messages lack a delimiter.
I personally consider this to be a minor bug. If it was originally designed without a separator, I sincerely apologize for any inconvenience this may have caused

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions