src/api_schema/schema.rs: improve error messages

This commit is contained in:
Dietmar Maurer 2019-05-19 10:18:51 +02:00
parent 0c516b123d
commit 178ac042c4

View File

@ -110,13 +110,13 @@ impl IntegerSchema {
if let Some(minimum) = self.minimum {
if value < minimum {
bail!("value must have a minimum value of {}", minimum);
bail!("value must have a minimum value of {} (got {})", minimum, value);
}
}
if let Some(maximum) = self.maximum {
if value > maximum {
bail!("value must have a maximum value of {}", maximum);
bail!("value must have a maximum value of {} (got {})", maximum, value);
}
}