Commit 602f8754 authored by Milo Yip's avatar Milo Yip

Add a failed case

parent 05ae5935
...@@ -870,6 +870,7 @@ private: ...@@ -870,6 +870,7 @@ private:
if (CurrentContext().valueSchema) if (CurrentContext().valueSchema)
PushSchema(*CurrentContext().valueSchema); PushSchema(*CurrentContext().valueSchema);
return true;
} }
} }
......
...@@ -425,3 +425,13 @@ TEST(SchemaValidator, Null) { ...@@ -425,3 +425,13 @@ TEST(SchemaValidator, Null) {
VALIDATE(s, "0", false); VALIDATE(s, "0", false);
VALIDATE(s, "\"\"", false); VALIDATE(s, "\"\"", false);
} }
TEST(SchemaValidator, ObjectInArray) {
Document sd;
sd.Parse("{\"type\":\"array\", \"items\": { \"type\":\"string\" }}");
Schema s(sd);
VALIDATE(s, "[]", true);
VALIDATE(s, "[1]", false);
VALIDATE(s, "[{}]", false);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment