@@ -471,7 +471,6 @@ class Schema {
471
471
exclusiveMaximum_(false ),
472
472
defaultValueLength_(0 )
473
473
{
474
- // std::cout << "Schema constructor " << schemaDocument << std::endl; // SMH
475
474
typedef typename ValueType::ConstValueIterator ConstValueIterator;
476
475
typedef typename ValueType::ConstMemberIterator ConstMemberIterator;
477
476
@@ -903,7 +902,6 @@ class Schema {
903
902
}
904
903
905
904
bool StartObject (Context& context) const {
906
- // std::cout << " schema StartObject" << std::endl; // SMH
907
905
if (!(type_ & (1 << kObjectSchemaType ))) {
908
906
DisallowedType (context, GetObjectString ());
909
907
RAPIDJSON_INVALID_KEYWORD_RETURN (kValidateErrorType );
@@ -925,7 +923,6 @@ class Schema {
925
923
}
926
924
927
925
bool Key (Context& context, const Ch* str, SizeType len, bool ) const {
928
- // std::cout << " schema Key" << std::endl; // SMH
929
926
if (patternProperties_) {
930
927
context.patternPropertiesSchemaCount = 0 ;
931
928
for (SizeType i = 0 ; i < patternPropertyCount_; i++)
@@ -977,7 +974,6 @@ class Schema {
977
974
}
978
975
979
976
bool EndObject (Context& context, SizeType memberCount) const {
980
- // std::cout << " schema EndObject with members " << memberCount << std::endl; // SMH
981
977
if (hasRequired_) {
982
978
context.error_handler .StartMissingProperties ();
983
979
for (SizeType index = 0 ; index < propertyCount_; index++)
@@ -1025,7 +1021,6 @@ class Schema {
1025
1021
}
1026
1022
1027
1023
bool StartArray (Context& context) const {
1028
- // std::cout << " schema StartArray" << std::endl; // SMH
1029
1024
context.arrayElementIndex = 0 ;
1030
1025
context.inArray = true ; // Ensure we note that we are in an array
1031
1026
@@ -1038,7 +1033,6 @@ class Schema {
1038
1033
}
1039
1034
1040
1035
bool EndArray (Context& context, SizeType elementCount) const {
1041
- // std::cout << " schema EndArray" << std::endl; // SMH
1042
1036
context.inArray = false ;
1043
1037
1044
1038
if (elementCount < minItems_) {
@@ -1613,7 +1607,6 @@ class GenericSchemaDocument {
1613
1607
schemaMap_(allocator, kInitialSchemaMapSize ),
1614
1608
schemaRef_(allocator, kInitialSchemaRefSize )
1615
1609
{
1616
- // std::cout << "schema document constructor " << root_ << std::endl; // SMH
1617
1610
if (!allocator_)
1618
1611
ownAllocator_ = allocator_ = RAPIDJSON_NEW (Allocator)();
1619
1612
@@ -1884,7 +1877,6 @@ class GenericSchemaValidator :
1884
1877
, depth_(0 )
1885
1878
#endif
1886
1879
{
1887
- // std::cout << "validator constructor" << std::endl; // SMH
1888
1880
}
1889
1881
1890
1882
// ! Constructor with output handler.
@@ -1917,7 +1909,6 @@ class GenericSchemaValidator :
1917
1909
, depth_(0 )
1918
1910
#endif
1919
1911
{
1920
- // std::cout << "validator constructor with handler" << std::endl; // SMH
1921
1912
}
1922
1913
1923
1914
// ! Destructor.
@@ -2154,7 +2145,7 @@ class GenericSchemaValidator :
2154
2145
AddCurrentError (kValidateErrorType );
2155
2146
}
2156
2147
void NotAllOf (ISchemaValidator** subvalidators, SizeType count) {
2157
- // Treat allOf like oneOf and anyOf for clarity
2148
+ // Treat allOf like oneOf and anyOf to match https://rapidjson.org/md_doc_schema.html#allOf-anyOf-oneOf
2158
2149
AddErrorArray (kValidateErrorAllOf , subvalidators, count);
2159
2150
// for (SizeType i = 0; i < count; ++i) {
2160
2151
// MergeError(static_cast<GenericSchemaValidator*>(subvalidators[i])->GetError());
@@ -2211,7 +2202,6 @@ RAPIDJSON_MULTILINEMACRO_END
2211
2202
2212
2203
#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ (method, arg2 )\
2213
2204
for (Context* context = schemaStack_.template Bottom<Context>(); context != schemaStack_.template End<Context>(); context++) {\
2214
- /* std::cout << " ++Parallel context: " << context << std::endl;*/ \
2215
2205
if (context->hasher )\
2216
2206
static_cast <HasherType*>(context->hasher )->method arg2;\
2217
2207
if (context->validators )\
@@ -2224,11 +2214,9 @@ RAPIDJSON_MULTILINEMACRO_END
2224
2214
2225
2215
#define RAPIDJSON_SCHEMA_HANDLE_END_ (method, arg2 )\
2226
2216
valid_ = (EndValue() || GetContinueOnErrors()) && (!outputHandler_ || outputHandler_->method arg2);\
2227
- /* std::cout << "### EndValue returns " << valid_ << std::endl;*/ \
2228
2217
return valid_;
2229
2218
2230
2219
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_ (method, arg1, arg2 ) \
2231
- /* std::cout << "validator Value " << this << std::endl;*/ \
2232
2220
RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (method, arg1);\
2233
2221
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ (method, arg2);\
2234
2222
RAPIDJSON_SCHEMA_HANDLE_END_ (method, arg2)
@@ -2246,14 +2234,12 @@ RAPIDJSON_MULTILINEMACRO_END
2246
2234
{ RAPIDJSON_SCHEMA_HANDLE_VALUE_ (String, (CurrentContext (), str, length, copy), (str, length, copy)); }
2247
2235
2248
2236
bool StartObject () {
2249
- // std::cout << "validator StartObject " << this << std::endl; // SMH
2250
2237
RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (StartObject, (CurrentContext ()));
2251
2238
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ (StartObject, ());
2252
2239
return valid_ = !outputHandler_ || outputHandler_->StartObject ();
2253
2240
}
2254
2241
2255
2242
bool Key (const Ch* str, SizeType len, bool copy) {
2256
- // std::cout << "validator Key: " << str << " " << this << (valid_ ? " true" : " false") << std::endl; // SMH
2257
2243
if (!valid_) return false ;
2258
2244
AppendToken (str, len);
2259
2245
if (!CurrentSchema ().Key (CurrentContext (), str, len, copy) && !GetContinueOnErrors ()) return valid_ = false ;
@@ -2262,22 +2248,19 @@ RAPIDJSON_MULTILINEMACRO_END
2262
2248
}
2263
2249
2264
2250
bool EndObject (SizeType memberCount) {
2265
- // std::cout << "validator EndObject " << this << std::endl; // SMH
2266
2251
if (!valid_) return false ;
2267
2252
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ (EndObject, (memberCount));
2268
2253
if (!CurrentSchema ().EndObject (CurrentContext (), memberCount) && !GetContinueOnErrors ()) return valid_ = false ;
2269
2254
RAPIDJSON_SCHEMA_HANDLE_END_ (EndObject, (memberCount));
2270
2255
}
2271
2256
2272
2257
bool StartArray () {
2273
- // std::cout << "validator StartArray " << this << std::endl; // SMH
2274
2258
RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (StartArray, (CurrentContext ()));
2275
2259
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ (StartArray, ());
2276
2260
return valid_ = !outputHandler_ || outputHandler_->StartArray ();
2277
2261
}
2278
2262
2279
2263
bool EndArray (SizeType elementCount) {
2280
- // std::cout << "validator EndArray " << this << std::endl; // SMH
2281
2264
if (!valid_) return false ;
2282
2265
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_ (EndArray, (elementCount));
2283
2266
if (!CurrentSchema ().EndArray (CurrentContext (), elementCount) && !GetContinueOnErrors ()) return valid_ = false ;
@@ -2297,7 +2280,6 @@ RAPIDJSON_MULTILINEMACRO_END
2297
2280
#endif
2298
2281
&GetStateAllocator ());
2299
2282
sv->SetValidateFlags (inheritContinueOnErrors ? GetValidateFlags () : GetValidateFlags () & ~kValidateContinueOnErrorFlag );
2300
- // std::cout << "***** New validator ***** " << sv << " " << sv->GetValidateFlags() << std::endl;
2301
2283
return sv;
2302
2284
}
2303
2285
@@ -2520,7 +2502,6 @@ RAPIDJSON_MULTILINEMACRO_END
2520
2502
}
2521
2503
2522
2504
void AddCurrentError (const ValidateErrorCode code, bool parent = false ) {
2523
- // std::cout << "==== AddCurrentError ======= " << SchemaType::GetValidateErrorKeyword(code).GetString() << std::endl;
2524
2505
AddErrorCode (currentError_, code);
2525
2506
AddErrorInstanceLocation (currentError_, parent);
2526
2507
AddErrorSchemaLocation (currentError_);
0 commit comments