|
|
@@ -1,5 +1,3 @@
|
|
|
-#include <string_view>
|
|
|
-
|
|
|
#include <gmock/gmock.h>
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
@@ -75,6 +73,24 @@ TEST(Annotation, NotSchemaFlipsAnnotationRule) {
|
|
|
EXPECT_THAT(result, ErrorAt(""_jptr, "/not"_jptr, "minimum", "6 >= 5"));
|
|
|
}
|
|
|
|
|
|
+TEST(Annotation, NotSchemaPropogatesDeeply) {
|
|
|
+ auto const schema = R"({
|
|
|
+ "not": {
|
|
|
+ "properties": {
|
|
|
+ "A": {
|
|
|
+ "enum": [ 1, 3, 4 ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })"_json;
|
|
|
+
|
|
|
+ auto const instance = R"({"A": 3})"_json;
|
|
|
+
|
|
|
+ jvalidate::ValidationResult result = validate(schema, instance);
|
|
|
+
|
|
|
+ EXPECT_THAT(result, ErrorAt("/A"_jptr, "/not/properties/A"_jptr, "enum", "1"));
|
|
|
+}
|
|
|
+
|
|
|
TEST(Annotation, PathFollowsSchemaNotConstraintModel) {
|
|
|
auto const schema = R"({
|
|
|
"$comment": "disallow is implemented in the form of NotConstraint[TypeConstraint]",
|