diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index 236e6d5..ec2dbc8 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -60,11 +60,11 @@ RAPIDJSON_MULTILINEMACRO_END #endif #define RAPIDJSON_INVALID_KEYWORD_RETURN(keyword)\ - RAPIDJSON_MULTILINEMACRO_BEGIN\ +RAPIDJSON_MULTILINEMACRO_BEGIN\ context.invalidKeyword = keyword;\ RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword);\ return false;\ - RAPIDJSON_MULTILINEMACRO_END +RAPIDJSON_MULTILINEMACRO_END RAPIDJSON_NAMESPACE_BEGIN @@ -460,10 +460,10 @@ public: // Array if (const ValueType* v = GetMember(value, "items")) { + PointerType q = p.Append("items"); if (v->IsObject()) // List validation - document->CreateSchema(&itemsList_, p, *v); + document->CreateSchema(&itemsList_, q, *v); else if (v->IsArray()) { // Tuple validation - PointerType q = p.Append("items"); itemsTuple_ = static_cast(allocator_->Malloc(sizeof(const Schema*) * v->Size())); SizeType index = 0; for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++) @@ -1126,7 +1126,6 @@ private: SValue minimum_; SValue maximum_; SValue multipleOf_; - bool hasMultipleOf_; bool exclusiveMinimum_; bool exclusiveMaximum_; }; diff --git a/test/unittest/schematest.cpp b/test/unittest/schematest.cpp index a1ec5de..41b0559 100644 --- a/test/unittest/schematest.cpp +++ b/test/unittest/schematest.cpp @@ -659,7 +659,7 @@ TEST(SchemaValidator, Array_ItemsList) { SchemaDocument s(sd); VALIDATE(s, "[1, 2, 3, 4, 5]", true); - INVALIDATE(s, "[1, 2, \"3\", 4, 5]", "", "type", "/2"); + INVALIDATE(s, "[1, 2, \"3\", 4, 5]", "/items", "type", "/2"); VALIDATE(s, "[]", true); } @@ -776,8 +776,8 @@ TEST(SchemaValidator, ObjectInArray) { SchemaDocument s(sd); VALIDATE(s, "[\"a\"]", true); - INVALIDATE(s, "[1]", "", "type", "/0"); - INVALIDATE(s, "[{}]", "", "type", "/0"); + INVALIDATE(s, "[1]", "/items", "type", "/0"); + INVALIDATE(s, "[{}]", "/items", "type", "/0"); } TEST(SchemaValidator, MultiTypeInObject) {