Source code for validatex.reporting.json_report

"""JSON report generator."""

from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from validatex.core.result import ValidationResult


[docs] class JSONReportGenerator: """Write a ValidationResult to a JSON file."""
[docs] def generate(self, result: "ValidationResult", filepath: str) -> None: result.to_json_file(filepath)