fix indentation
This commit is contained in:
parent
74931bd02a
commit
08d8a52a8a
@ -900,7 +900,7 @@ class numeric : public schema
|
|||||||
oss.seekp(0, std::ios::end);
|
oss.seekp(0, std::ios::end);
|
||||||
auto size = oss.tellp();
|
auto size = oss.tellp();
|
||||||
if (size != 0) {
|
if (size != 0) {
|
||||||
oss.seekp(0, std::ios::beg);
|
oss.seekp(0, std::ios::beg);
|
||||||
e.error(ptr, instance, oss.str());
|
e.error(ptr, instance, oss.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,8 +22,8 @@ class custom_error_handler : public nlohmann::json_schema::basic_error_handler
|
|||||||
{
|
{
|
||||||
void error(const nlohmann::json::json_pointer &ptr, const json &instance, const std::string &message) override
|
void error(const nlohmann::json::json_pointer &ptr, const json &instance, const std::string &message) override
|
||||||
{
|
{
|
||||||
if (message != "instance exceeds maximum of 3.141592653589793")
|
if (message != "instance exceeds maximum of 3.141592653589793")
|
||||||
throw std::invalid_argument("Precision print does not work.");
|
throw std::invalid_argument("Precision print does not work.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ int main(void)
|
|||||||
{
|
{
|
||||||
json_validator validator;
|
json_validator validator;
|
||||||
|
|
||||||
auto instance = R"({ "angle": 3.1415927410125732 })"_json;
|
auto instance = R"({ "angle": 3.1415927410125732 })"_json;
|
||||||
|
|
||||||
validator.set_root_schema(schema);
|
validator.set_root_schema(schema);
|
||||||
custom_error_handler err;
|
custom_error_handler err;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user