From c78ca226a83b812412a7938e0a76225c61586a1e Mon Sep 17 00:00:00 2001 From: Patrick Boettcher Date: Thu, 12 Jan 2017 16:18:34 +0100 Subject: [PATCH] code cleanup and comment for a FIXME --- app/json-schema-validate.cpp | 4 +--- src/json-validator.cpp | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/json-schema-validate.cpp b/app/json-schema-validate.cpp index 7f5ca0d..8988017 100644 --- a/app/json-schema-validate.cpp +++ b/app/json-schema-validate.cpp @@ -37,7 +37,6 @@ static void usage(const char *name) exit(EXIT_FAILURE); } - #if 0 resolver r(nlohmann::json_schema_draft4::root_schema, nlohmann::json_schema_draft4::root_schema["id"]); @@ -63,7 +62,6 @@ int main(int argc, char *argv[]) if (argc != 2) usage(argv[0]); - std::fstream f(argv[1]); if (!f.good()) { std::cerr << "could not open " << argv[1] << " for reading\n"; @@ -80,7 +78,7 @@ int main(int argc, char *argv[]) } // 2) create the validator and - json_validator validator(loader, [](const std::string&, const std::string&){}); + json_validator validator(loader, [](const std::string &, const std::string &) {}); try { // insert this schema as the root to the validator diff --git a/src/json-validator.cpp b/src/json-validator.cpp index 47cb626..0c1bbbc 100644 --- a/src/json-validator.cpp +++ b/src/json-validator.cpp @@ -52,6 +52,7 @@ class resolver schema_refs[id] = &schema; for (auto i = schema.begin(), end = schema.end(); i != end; ++i) { + // FIXME: this inhibits the user adding elements with the key "default" if (i.key() == "default") /* default value can be objects, but are not schemas */ continue;