t/json-schema: reduce scope of schema and input
This commit is contained in:
parent
c810056a70
commit
2fbf9af8cb
@ -40,10 +40,10 @@ main (int argc, char **argv) {
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
auto schema = json::tree::parse (fs::path (argv[ARG_SCHEMA]));
|
auto schema = json::tree::parse (fs::path (argv[ARG_SCHEMA]));
|
||||||
auto input = json::tree::parse (fs::path (argv[ARG_INPUT]));
|
auto input = json::tree::parse (fs::path (argv[ARG_INPUT]));
|
||||||
|
|
||||||
try {
|
|
||||||
json::schema::validate (*input, schema->as_object ());
|
json::schema::validate (*input, schema->as_object ());
|
||||||
} catch (const json::error &e) {
|
} catch (const json::error &e) {
|
||||||
std::cerr << "error: " << e.what () << '\n';
|
std::cerr << "error: " << e.what () << '\n';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user