Update validator version
AzHicham opened this issue · comments
Hicham Azimani commented
Hello would it be possible to update validator version ?
I face some trait mismatch :/
Thank you
Timon Klinkert commented
Same issue here
Timon Klinkert commented
Struct:
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Validate, ToSchema)]
pub struct BudgetDTO {
#[validate(range(min = 0))]
pub amount: i64,
#[validate(length(min = 1, max = 255))]
pub name: String,
#[validate(length(min = 0, max = 255))]
pub description: Option<String>,
#[serde(with = "time::serde::rfc3339")]
#[validate(custom(function = validate_datetime_not_in_future))]
pub created_at: OffsetDateTime,
}
For a complete example look:
https://github.com/financrr/backend/tree/dependabot/cargo/validator-0.17.0