Merge pull request #1779 from pavel-pimenov/fix-1778-part-1

fix 1778  (part 1)
This commit is contained in:
Milo Yip 2021-02-23 10:23:34 +08:00 committed by GitHub
commit b1a4d91a53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -504,13 +504,13 @@ public:
AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document); AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document);
AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document); AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document);
AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document); AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document);
}
if (const ValueType* v = GetMember(value, GetNotString())) { if (const ValueType* v = GetMember(value, GetNotString())) {
schemaDocument->CreateSchema(&not_, p.Append(GetNotString(), allocator_), *v, document); schemaDocument->CreateSchema(&not_, p.Append(GetNotString(), allocator_), *v, document);
notValidatorIndex_ = validatorCount_; notValidatorIndex_ = validatorCount_;
validatorCount_++; validatorCount_++;
} }
}
// Object // Object
@ -953,7 +953,7 @@ public:
} }
if (additionalPropertiesSchema_) { if (additionalPropertiesSchema_) {
if (additionalPropertiesSchema_ && context.patternPropertiesSchemaCount > 0) { if (context.patternPropertiesSchemaCount > 0) {
context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_; context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_;
context.valueSchema = typeless_; context.valueSchema = typeless_;
context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty; context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty;