From 8125a3e35256ea6facc475ee312bdd6f0433a80d Mon Sep 17 00:00:00 2001 From: Patrick Boettcher
Date: Fri, 15 May 2020 09:33:26 +0200
Subject: [PATCH] after et_root_schema, throw if there are undef refs
fix #97
---
src/json-validator.cpp | 6 ++++++
test/issue-98.cpp | 9 +++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/json-validator.cpp b/src/json-validator.cpp
index 62bac0a..f16f3ef 100644
--- a/src/json-validator.cpp
+++ b/src/json-validator.cpp
@@ -239,6 +239,12 @@ public:
if (!new_schema_loaded) // if no new schema loaded, no need to try again
break;
} while (1);
+
+ for (const auto &file : files_)
+ if (file.second.unresolved.size() != 0)
+ throw std::invalid_argument("after all files have been parsed, '" +
+ (file.first == "" ? "