MCPcopy Create free account
hub / github.com/pboettch/json-schema-validator / loader

Function loader

test/json-schema-validate.cpp:24–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24static void loader(const json_uri &uri, json &schema)
25{
26 std::string filename = "./" + uri.path();
27 std::ifstream lf(filename);
28 if (!lf.good())
29 throw std::invalid_argument("could not open " + uri.url() + " tried with " + filename);
30 try {
31 lf >> schema;
32 } catch (const std::exception &e) {
33 throw e;
34 }
35}
36
37class custom_error_handler : public nlohmann::json_schema::basic_error_handler
38{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected