json-schema: print the validated schema

The validation process may modify the supplied JSON and it's useful for
debugging purposes to visualise any defaulted values.
This commit is contained in:
Danny Robson 2018-06-22 14:09:23 +10:00
parent 65dad60e09
commit a95388b02b

View File

@ -54,6 +54,8 @@ main (int argc, char **argv) {
auto input = json::tree::parse (util::view{input_src} .cast<const char*>()); auto input = json::tree::parse (util::view{input_src} .cast<const char*>());
json::schema::validate (*input, schema->as_object ()); json::schema::validate (*input, schema->as_object ());
std::cout << *input << '\n';
} catch (const json::error &e) { } catch (const json::error &e) {
std::cerr << "error: " << e.what () << '\n'; std::cerr << "error: " << e.what () << '\n';
return EXIT_FAILURE; return EXIT_FAILURE;