fix message if value is too low (minimum)

A value is rather "below" a minimum than "exceeding" it
This commit is contained in:
Patrick Boettcher 2018-02-09 10:25:08 +01:00
parent 0d50c716b6
commit ad9e9923ab

View File

@ -217,7 +217,7 @@ void validate_numeric(const json &schema, const std::string &name, double value)
const auto &minimum = schema.find("minimum");
if (minimum != schema.end()) {
double mini = minimum.value();
auto ex = std::out_of_range(name + " exceeds minimum of " + std::to_string(mini));
auto ex = std::out_of_range(name + " is below the minimum of " + std::to_string(mini));
if (schema.find("exclusiveMinimum") != schema.end()) {
if (value <= mini)
throw ex;