@@ -474,7 +474,7 @@ class logical_combination : public schema
474
474
esub.propagate (error_summary, " case#" + std::to_string (index ) + " ] " );
475
475
}
476
476
477
- if (is_validate_complete (instance, ptr, e, esub, count))
477
+ if (is_validate_complete (instance, ptr, e, esub, count, index ))
478
478
return ;
479
479
}
480
480
@@ -486,7 +486,7 @@ class logical_combination : public schema
486
486
487
487
// specialized for each of the logical_combination_types
488
488
static const std::string key;
489
- static bool is_validate_complete (const json &, const json::json_pointer &, error_handler &, const logical_combination_error_handler &, size_t );
489
+ static bool is_validate_complete (const json &, const json::json_pointer &, error_handler &, const logical_combination_error_handler &, size_t , size_t );
490
490
491
491
public:
492
492
logical_combination (json &sch,
@@ -511,21 +511,24 @@ template <>
511
511
const std::string logical_combination<oneOf>::key = " oneOf" ;
512
512
513
513
template <>
514
- bool logical_combination<allOf>::is_validate_complete(const json &, const json::json_pointer &, error_handler &e, const logical_combination_error_handler &esub, size_t )
514
+ bool logical_combination<allOf>::is_validate_complete(const json &, const json::json_pointer &, error_handler &e, const logical_combination_error_handler &esub, size_t , size_t current_schema_index )
515
515
{
516
516
if (esub)
517
+ {
517
518
e.error (esub.error_entry_list_ .front ().ptr_ , esub.error_entry_list_ .front ().instance_ , " at least one subschema has failed, but all of them are required to validate - " + esub.error_entry_list_ .front ().message_ );
519
+ esub.propagate (e, " [combination: allOf / case#" + std::to_string (current_schema_index) + " ] " );
520
+ }
518
521
return esub;
519
522
}
520
523
521
524
template <>
522
- bool logical_combination<anyOf>::is_validate_complete(const json &, const json::json_pointer &, error_handler &, const logical_combination_error_handler &, size_t count)
525
+ bool logical_combination<anyOf>::is_validate_complete(const json &, const json::json_pointer &, error_handler &, const logical_combination_error_handler &, size_t count, size_t )
523
526
{
524
527
return count == 1 ;
525
528
}
526
529
527
530
template <>
528
- bool logical_combination<oneOf>::is_validate_complete(const json &instance, const json::json_pointer &ptr, error_handler &e, const logical_combination_error_handler &, size_t count)
531
+ bool logical_combination<oneOf>::is_validate_complete(const json &instance, const json::json_pointer &ptr, error_handler &e, const logical_combination_error_handler &, size_t count, size_t )
529
532
{
530
533
if (count > 1 )
531
534
e.error (ptr, instance, " more than one subschema has succeeded, but exactly one of them is required to validate" );
0 commit comments