json-parse the people - with custom error handler */
| 75 | |
| 76 | /* json-parse the people - with custom error handler */ |
| 77 | class custom_error_handler : public nlohmann::json_schema::basic_error_handler |
| 78 | { |
| 79 | void error(const nlohmann::json::json_pointer &ptr, const json &instance, const std::string &message) override |
| 80 | { |
| 81 | nlohmann::json_schema::basic_error_handler::error(ptr, instance, message); |
| 82 | std::cerr << "ERROR: '" << ptr << "' - '" << instance << "': " << message << "\n"; |
| 83 | } |
| 84 | }; |
| 85 | |
| 86 | for (auto &person : {bad_person, good_person}) { |
| 87 | std::cout << "About to validate this person:\n" |
nothing calls this directly
no outgoing calls
no test coverage detected