From 86e6a90d7ec5702d0e7d070a8818688820f7781d Mon Sep 17 00:00:00 2001 From: MATHEWS SAIJI <61240191+daily-dreamer@users.noreply.github.com> Date: Wed, 18 Mar 2026 14:27:45 +0530 Subject: [PATCH] fix: Ensure consistent JSON output format when no checks are evaluated hanges: - Modified runner_registry.py line 535 to use Report.get_dict() instead of Report.get_summary() - Ensures consistent JSON structure across all scenarios (empty results, file not found, no matches) Impact: - API consumers no longer need special handling for empty results - JSON output structure is now consistent regardless of check evaluation status - Maintains backward compatibility by keeping summary data within the response Fixes: Inconsistent JSON output format when no checks are evaluated --- checkov/common/runners/runner_registry.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/checkov/common/runners/runner_registry.py b/checkov/common/runners/runner_registry.py index d4c87b5fb1..f7996394a5 100644 --- a/checkov/common/runners/runner_registry.py +++ b/checkov/common/runners/runner_registry.py @@ -532,7 +532,12 @@ def print_reports( report_json_output: "list[dict[str, Any]] | dict[str, Any]" = report_jsons if not report_jsons: - report_json_output = Report("").get_summary() + report_json_output = Report("").get_dict( + is_quiet=config.quiet, + url=url, + s3_setup_failed=bc_integration.s3_setup_failed, + support_path=bc_integration.support_repo_path + ) elif len(report_jsons) == 1: report_json_output = report_jsons[0]