Convert an InspectionReport to a plain JSON-serializable object — counts, per-code aggregation (with friendly labels), and every issue. Suitable for JSON.stringify straight out of the box.
JSON.stringify
Sample output:
{ "generatedAt": "2026-04-30T12:34:56.789Z", "counts": {"error": 0, "warning": 12, "info": 0, "total": 12}, "byCode": [ {"code": "GEOMETRY_DUPLICATE", "label": "Duplicate geometry", "count": 8, "severity": "warning"}, ... ], "issues": [ {"severity": "warning", "code": "GEOMETRY_DUPLICATE", "message": "...", "summary": "...", ...}, ... ]} Copy
{ "generatedAt": "2026-04-30T12:34:56.789Z", "counts": {"error": 0, "warning": 12, "info": 0, "total": 12}, "byCode": [ {"code": "GEOMETRY_DUPLICATE", "label": "Duplicate geometry", "count": 8, "severity": "warning"}, ... ], "issues": [ {"severity": "warning", "code": "GEOMETRY_DUPLICATE", "message": "...", "summary": "...", ...}, ... ]}
Convert an InspectionReport to a plain JSON-serializable object — counts, per-code aggregation (with friendly labels), and every issue. Suitable for
JSON.stringifystraight out of the box.Sample output: