mirror of
https://github.com/tristanpenman/valijson.git
synced 2025-01-19 08:46:42 +01:00
Ensure validation state is not discarded after checking for an 'additionalProperties' constraint
This commit is contained in:
parent
b241b37d7a
commit
e9b50162bf
@ -853,7 +853,17 @@ public:
|
||||
const Subschema *additionalPropertiesSubschema =
|
||||
constraint.getAdditionalPropertiesSubschema();
|
||||
if (!additionalPropertiesSubschema) {
|
||||
return propertiesMatched.size() == target.getObjectSize();
|
||||
if (propertiesMatched.size() != target.getObjectSize()) {
|
||||
if (results) {
|
||||
results->pushError(context, "Object contains properties "
|
||||
"that could not be validated using 'properties' "
|
||||
"or 'additionalProperties' constraints");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return validated;
|
||||
}
|
||||
|
||||
BOOST_FOREACH( const typename AdapterType::ObjectMember m, object ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user