Skip to content

Commit fbd72de

Browse files
serge-spboettch
authored andcommitted
Run clang-format
Fix pre-commit workflow failures
1 parent 813eb63 commit fbd72de

File tree

2 files changed

+181
-200
lines changed

2 files changed

+181
-200
lines changed

src/json-validator.cpp

+8-10
Original file line numberDiff line numberDiff line change
@@ -429,26 +429,25 @@ enum logical_combination_types {
429429
class logical_combination_error_handler : public error_handler
430430
{
431431
public:
432-
struct error_entry
433-
{
432+
struct error_entry {
434433
json::json_pointer ptr_;
435434
json instance_;
436435
std::string message_;
437436
};
438437

439438
std::vector<error_entry> error_entry_list_;
440-
439+
441440
void error(const json::json_pointer &ptr, const json &instance, const std::string &message) override
442441
{
443-
error_entry_list_.push_back(error_entry{ ptr, instance, message });
442+
error_entry_list_.push_back(error_entry{ptr, instance, message});
444443
}
445444

446-
void propagate(error_handler& e, const std::string& prefix) const
445+
void propagate(error_handler &e, const std::string &prefix) const
447446
{
448-
for (const error_entry& entry : error_entry_list_)
447+
for (const error_entry &entry : error_entry_list_)
449448
e.error(entry.ptr_, entry.instance_, prefix + entry.message_);
450449
}
451-
450+
452451
operator bool() const { return !error_entry_list_.empty(); }
453452
};
454453

@@ -463,7 +462,7 @@ class logical_combination : public schema
463462
logical_combination_error_handler error_summary;
464463

465464
for (std::size_t index = 0; index < subschemata_.size(); ++index) {
466-
const std::shared_ptr<schema>& s = subschemata_[index];
465+
const std::shared_ptr<schema> &s = subschemata_[index];
467466
logical_combination_error_handler esub;
468467
auto oldPatchSize = patch.get_json().size();
469468
s->validate(ptr, instance, patch, esub);
@@ -513,8 +512,7 @@ const std::string logical_combination<oneOf>::key = "oneOf";
513512
template <>
514513
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)
515514
{
516-
if (esub)
517-
{
515+
if (esub) {
518516
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_);
519517
esub.propagate(e, "[combination: allOf / case#" + std::to_string(current_schema_index) + "] ");
520518
}

0 commit comments

Comments
 (0)