Skip to content

Commit

Permalink
Make subschema constraint validation clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanpenman committed Aug 24, 2023
1 parent 0530af0 commit 0b7efb3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/valijson/subschema.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ class Subschema
{
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;
Expand Down

0 comments on commit 0b7efb3

Please sign in to comment.