t/json-schema: reduce scope of schema and input

This commit is contained in:
Danny Robson 2016-04-27 17:09:48 +10:00
parent c810056a70
commit 2fbf9af8cb

View File

@ -40,10 +40,10 @@ main (int argc, char **argv) {
return EXIT_FAILURE;
}
auto schema = json::tree::parse (fs::path (argv[ARG_SCHEMA]));
auto input = json::tree::parse (fs::path (argv[ARG_INPUT]));
try {
auto schema = json::tree::parse (fs::path (argv[ARG_SCHEMA]));
auto input = json::tree::parse (fs::path (argv[ARG_INPUT]));
json::schema::validate (*input, schema->as_object ());
} catch (const json::error &e) {
std::cerr << "error: " << e.what () << '\n';