Update 'required' constraint to match v7 tests

This commit is contained in:
Tristan Penman 2019-09-24 21:22:15 +10:00
parent 98d804a367
commit 5430e79754
2 changed files with 5 additions and 6 deletions

View File

@ -1013,11 +1013,7 @@ public:
virtual bool visit(const RequiredConstraint &constraint) virtual bool visit(const RequiredConstraint &constraint)
{ {
if ((strictTypes && !target.isObject()) || !target.maybeObject()) { if ((strictTypes && !target.isObject()) || !target.maybeObject()) {
if (results) { return true;
results->pushError(context,
"Object required to validate 'required' properties.");
}
return false;
} }
bool validated = true; bool validated = true;

View File

@ -554,7 +554,10 @@ TEST_F(TestValidator, Draft7_Properties)
// TODO: broken refRemote // TODO: broken refRemote
// TODO: broken required TEST_F(TestValidator, Draft7_Required)
{
processDraft7TestFile(TEST_SUITE_DIR "draft7/required.json");
}
TEST_F(TestValidator, Draft7_Type) TEST_F(TestValidator, Draft7_Type)
{ {