Closed vsilent closed 7 months ago
It looks like field is validated anyway, even it's wrapped with the Option, is it default behaviour or a bug? for example:
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Validate)] pub struct Port { #[validate(pattern = r"^\d{2,6}+$")] pub host_port: Option<String>,
I expected this field not to be validated when empty or should I use rules for that case ?
Sorry my bad, not an issue, because I get Some("") not None
It looks like field is validated anyway, even it's wrapped with the Option, is it default behaviour or a bug?
for example:
I expected this field not to be validated when empty or should I use rules for that case ?