| 623 | } |
| 624 | |
| 625 | RAPIDJSON_FORCEINLINE bool EndValue(Context& context) const { |
| 626 | if (context.patternPropertiesValidatorCount > 0) { |
| 627 | bool otherValid = false; |
| 628 | SizeType count = context.patternPropertiesValidatorCount; |
| 629 | if (context.objectPatternValidatorType != Context::kPatternValidatorOnly) |
| 630 | otherValid = context.patternPropertiesValidators[--count]->IsValid(); |
| 631 | |
| 632 | bool patternValid = true; |
| 633 | for (SizeType i = 0; i < count; i++) |
| 634 | if (!context.patternPropertiesValidators[i]->IsValid()) { |
| 635 | patternValid = false; |
| 636 | break; |
| 637 | } |
| 638 | |
| 639 | if (context.objectPatternValidatorType == Context::kPatternValidatorOnly) { |
| 640 | if (!patternValid) |
| 641 | RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); |
| 642 | } |
| 643 | else if (context.objectPatternValidatorType == Context::kPatternValidatorWithProperty) { |
| 644 | if (!patternValid || !otherValid) |
| 645 | RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); |
| 646 | } |
| 647 | else if (!patternValid && !otherValid) // kPatternValidatorWithAdditionalProperty) |
| 648 | RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString()); |
| 649 | } |
| 650 | |
| 651 | if (enum_) { |
| 652 | const uint64_t h = context.factory.GetHashCode(context.hasher); |
| 653 | for (SizeType i = 0; i < enumCount_; i++) |
| 654 | if (enum_[i] == h) |
| 655 | goto foundEnum; |
| 656 | RAPIDJSON_INVALID_KEYWORD_RETURN(GetEnumString()); |
| 657 | foundEnum:; |
| 658 | } |
| 659 | |
| 660 | if (allOf_.schemas) |
| 661 | for (SizeType i = allOf_.begin; i < allOf_.begin + allOf_.count; i++) |
| 662 | if (!context.validators[i]->IsValid()) |
| 663 | RAPIDJSON_INVALID_KEYWORD_RETURN(GetAllOfString()); |
| 664 | |
| 665 | if (anyOf_.schemas) { |
| 666 | for (SizeType i = anyOf_.begin; i < anyOf_.begin + anyOf_.count; i++) |
| 667 | if (context.validators[i]->IsValid()) |
| 668 | goto foundAny; |
| 669 | RAPIDJSON_INVALID_KEYWORD_RETURN(GetAnyOfString()); |
| 670 | foundAny:; |
| 671 | } |
| 672 | |
| 673 | if (oneOf_.schemas) { |
| 674 | bool oneValid = false; |
| 675 | for (SizeType i = oneOf_.begin; i < oneOf_.begin + oneOf_.count; i++) |
| 676 | if (context.validators[i]->IsValid()) { |
| 677 | if (oneValid) |
| 678 | RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString()); |
| 679 | else |
| 680 | oneValid = true; |
| 681 | } |
| 682 | if (!oneValid) |
no test coverage detected