Skip to content

Commit 053171c

Browse files
authored
Merge pull request #314 from python-jsonschema/bugfix-bad-forelse
Fix a minor bug with verbose output
2 parents 34fc50a + e45d52d commit 053171c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Unreleased
1010

1111
.. vendor-insert-here
1212
13+
- Fix a minor bug with the verbose output introduced in v0.26.2
14+
1315
0.26.2
1416
------
1517

src/check_jsonschema/checker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ def _build_result(self) -> CheckResult:
6969
result.record_parse_error(path, data)
7070
else:
7171
validator = self.get_validator(path, data)
72+
passing = True
7273
for err in validator.iter_errors(data):
7374
result.record_validation_error(path, err)
74-
else:
75+
passing = False
76+
if passing:
7577
result.record_validation_success(path)
7678
return result
7779

src/check_jsonschema/reporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def _dump_parse_errors(
199199
def report_errors(self, result: CheckResult) -> None:
200200
report_obj: dict[str, t.Any] = {"status": "fail"}
201201
if self.verbosity > 1:
202-
report_obj["checked_paths"] = list(result.successes)
202+
report_obj["successes"] = list(result.successes)
203203
if self.verbosity > 0:
204204
report_obj["errors"] = list(self._dump_error_map(result.validation_errors))
205205
report_obj["parse_errors"] = list(

0 commit comments

Comments
 (0)