mirror of
https://github.com/tristanpenman/valijson.git
synced 2024-12-12 10:13:51 +01:00
check the type constraint first because others might rely on it
This commit is contained in:
parent
f1902801d6
commit
f716227d0a
@ -624,6 +624,14 @@ private:
|
|||||||
updatedScope = currentScope;
|
updatedScope = currentScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the type constraint first to be the first one to check because other constraints may rely on it
|
||||||
|
if ((itr = object.find("type")) != object.end()) {
|
||||||
|
rootSchema.addConstraintToSubschema(
|
||||||
|
makeTypeConstraint(rootSchema, rootNode, itr->second, updatedScope, nodePath + "/type", fetchDoc,
|
||||||
|
docCache, schemaCache),
|
||||||
|
&subschema);
|
||||||
|
}
|
||||||
|
|
||||||
if ((itr = object.find("allOf")) != object.end()) {
|
if ((itr = object.find("allOf")) != object.end()) {
|
||||||
rootSchema.addConstraintToSubschema(
|
rootSchema.addConstraintToSubschema(
|
||||||
makeAllOfConstraint(rootSchema, rootNode, itr->second,
|
makeAllOfConstraint(rootSchema, rootNode, itr->second,
|
||||||
@ -925,13 +933,6 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((itr = object.find("type")) != object.end()) {
|
|
||||||
rootSchema.addConstraintToSubschema(
|
|
||||||
makeTypeConstraint(rootSchema, rootNode, itr->second, updatedScope, nodePath + "/type", fetchDoc,
|
|
||||||
docCache, schemaCache),
|
|
||||||
&subschema);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((itr = object.find("uniqueItems")) != object.end()) {
|
if ((itr = object.find("uniqueItems")) != object.end()) {
|
||||||
opt::optional<constraints::UniqueItemsConstraint> constraint = makeUniqueItemsConstraint(itr->second);
|
opt::optional<constraints::UniqueItemsConstraint> constraint = makeUniqueItemsConstraint(itr->second);
|
||||||
if (constraint) {
|
if (constraint) {
|
||||||
|
Loading…
Reference in New Issue
Block a user