Use asBool() instead of getBool() when parsing 'additionalItems' and 'required' constraints

This commit is contained in:
Tristan Penman 2016-01-14 21:47:54 +11:00
parent 29367ccf0b
commit 222e593733

View File

@ -1153,7 +1153,7 @@ private:
additionalProperties->maybeBool()) {
// If it has a boolean value that is 'true', then an empty
// schema should be used.
if (additionalProperties->getBool()) {
if (additionalProperties->asBool()) {
additionalPropertiesSchema.reset(new Schema());
}
} else if (additionalProperties->isObject()) {
@ -1206,7 +1206,7 @@ private:
throw std::runtime_error("Expected boolean value for 'required' attribute.");
}
if (node.getBool()) {
if (node.asBool()) {
constraints::RequiredConstraint::RequiredProperties requiredProperties;
requiredProperties.insert(name);
return new constraints::RequiredConstraint(requiredProperties);