7 std::ifstream input(file_path);
8 return nlohmann::json::parse(input);
12 const nlohmann::json &imported_data,
13 const nlohmann::json &schema
15 nlohmann::json_schema::json_validator validator;
18 validator.set_root_schema(schema);
19 }
catch (
const std::exception &e) {
20 std::cerr <<
"Schema validation failed: " << e.what() << std::endl;
25 auto data_validation_result = validator.validate(imported_data);
27 }
catch (
const std::exception &e) {
bool json_matches_schema(const nlohmann::json &imported_data, const nlohmann::json &schema)
nlohmann::json import_json(std::string file_path)