#[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
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