50{
51 if (logger_type == logging::logger_type_t::text) {
52 ostr << "ERROR: Invalid schema:\n";
53 for (const auto &schema_error : e.errors) {
54 std::cout << " - " << schema_error.description() << '\n';
55 }
56 }
57 else {
58 inja::json j;
59 j["valid"] = false;
60 j["errors"] = inja::json::array();
61 for (const auto &schema_error : e.errors) {
62 inja::json je;
63 je["path"] = schema_error.path;
64 je["error_type"] = to_string(schema_error.type);
65 je["description"] = schema_error.description();
66 j["errors"].emplace_back(std::move(je));
67 }
68 ostr << j.dump();
69 }
70}