diff --git a/include/valijson/subschema.hpp b/include/valijson/subschema.hpp index 5e22bf5..b74806e 100644 --- a/include/valijson/subschema.hpp +++ b/include/valijson/subschema.hpp @@ -120,7 +120,12 @@ public: { bool allTrue = true; for (auto &&constraint : m_constraints) { - allTrue = applyFunction(*constraint) && allTrue; + // Even if an application fails, we want to continue checking the + // schema. In that case we set allTrue to false, and then fall + // through to the next constraint + if (!applyFunction(*constraint)) { + allTrue = false; + } } return allTrue;