{
    "@programName": [[${programName}]],
    "@version": [[${zapVersion}]],
    "@generated": [[${generatedString}]],
    "created": [[${created}]],
    "site":[ [#th:block th:each="site, siteState: ${reportData.sites}"][#th:block th:if="${! siteState.first}"],[/th:block]
        {
            "@name": "[(${helper.legacyEscapeText(site, true)})]",
            "@host": "[(${helper.legacyEscapeText(helper.getHostForSite(site), true)})]",
            "@port": "[(${helper.getPortForSite(site)})]",
            "@ssl": "[(${helper.isSslSite(site)})]",
            "alerts": [ [#th:block th:each="alert, alertState: ${helper.getAlertsForSite(alertTree, site)}" th:with="instances=${helper.getAlertInstancesForSite(alertTree, site, alert.name, alert.risk)}"]
                {
                    "pluginid": "[(${alert.pluginId})]",
                    "alertRef": "[(${alert.alertRef})]",
                    "alert": "[(${helper.legacyEscapeText(alert.name, true)})]",
                    "name": "[(${helper.legacyEscapeText(alert.name, true)})]",
                    "riskcode": "[(${alert.risk})]",
                    "confidence": "[(${alert.confidence})]",
                    "riskdesc": "[(${helper.legacyEscapeText(helper.getRiskString(alert.risk) + ' (' + helper.getConfidenceString(alert.confidence) + ')', true)})]",
                    "desc": "[(${helper.legacyEscapeParagraph(alert.description, true)})]",
                    "instances":[ [#th:block th:each="instance, instState: ${instances}"][#th:block th:if="${! instState.first}"],[/th:block]
                        {
                            "id": "[(${instance.alertId})]",
                            "uri": "[(${helper.legacyEscapeText(instance.uri, true)})]",
                            "nodeName": [[${helper.getNodeName(instance)}]],
                            "method": "[(${helper.legacyEscapeText(instance.method, true)})]",
                            "param": "[(${helper.legacyEscapeTextAlertParam(instance, true)})]",
                            "attack": "[(${helper.legacyEscapeText(instance.attack, true)})]",
                            "evidence": "[(${helper.legacyEscapeText(instance.evidence, true)})]",
                            "otherinfo": "[(${helper.legacyEscapeText(instance.otherinfo, true)})]"[#th:block th:if="${instance.message}"],
                            "request-header": "[(${helper.legacyEscapeText(instance.message.requestHeader, true)})]",
                            "request-body": "[(${helper.legacyEscapeText(instance.message.requestBody, true)})]",
                            "response-header": "[(${helper.legacyEscapeText(instance.message.responseHeader, true)})]",
                            "response-body": "[(${helper.legacyEscapeText(instance.message.responseBody, true)})]"[/th:block]
                        }[/th:block]
                    ],
                    "count": "[(${instances.size})]",
                    "systemic": [[${helper.isSystemic(alert)}]],
                    "solution": "[(${helper.legacyEscapeParagraph(alert.solution, true)})]",
                    "otherinfo": "[(${helper.legacyEscapeParagraph(alert.otherinfo, true)})]",
                    "reference": "[(${helper.legacyEscapeParagraph(alert.reference, true)})]",
                    "cweid": "[(${alert.cweid})]",
                    "wascid": "[(${alert.wascid})]",
                    "sourceid": "[(${alert.sourceHistoryId})]",
                    "tags":[ [#th:block th:each="tag, tagState: ${alert.tags}"][#th:block th:if="${! tagState.first}"],[/th:block]
                        {
                            "tag": [[${tag.key}]],
                            "link": [[${tag.value}]]
                        }[/th:block]
                    ]
                }[#th:block th:if="${! alertState.last}"],[/th:block][/th:block]
            ][#th:block th:if="${reportData.isIncludeSection('statistics')}"],
            "statistics":{ [#th:block th:each="stat, statState: ${helper.getSiteStats(site, '')}"][#th:block th:if="${! statState.first}"],[/th:block]
                [[${stat.key}]]: [[${stat.value}]]
                [/th:block]
            }[/th:block]
        }[/th:block]
    ][#th:block th:if="${reportData.isIncludeSection('sequencedetails') && reportData.reportObjects.get('seqAScanData') != null}"],
    "sequences":[[#th:block th:each="seq, seqState: ${reportData.reportObjects.get('seqAScanData').seqData}"][#th:block th:if="${! seqState.first}"],[/th:block]
        {
            "name": "[(${seq.sequenceName})]",
            "steps": [[#th:block th:each="step, stepState: ${seq.steps}"][#th:block th:if="${! stepState.first}"],[/th:block]
                {
                "step": "[(${step.step})]",
                "pass": "[(${step.pass})]",
                "resultDetails": "[(${step.result})]",
                "alertIds": [[(${step.alertIds})]],
                "original":
                    {
                        "uri": "[(${helper.legacyEscapeText(step.originalMsg.requestHeader.uri, true)})]",
                        "method": "[(${helper.legacyEscapeText(step.originalMsg.requestHeader.method, true)})]",
                        "request-header": "[(${helper.legacyEscapeText(step.originalMsg.requestHeader, true)})]",
                        "request-body": "[(${helper.legacyEscapeText(step.originalMsg.requestBody, true)})]",
                        "response-header": "[(${helper.legacyEscapeText(step.originalMsg.responseHeader, true)})]",
                        "response-body": "[(${helper.legacyEscapeText(step.originalMsg.responseBody, true)})]"
                    },
                "replay":
                    {
                        "uri": "[(${helper.legacyEscapeText(step.replayMsg.requestHeader.uri, true)})]",
                        "method": "[(${helper.legacyEscapeText(step.replayMsg.requestHeader.method, true)})]",
                        "request-header": "[(${helper.legacyEscapeText(step.replayMsg.requestHeader, true)})]",
                        "request-body": "[(${helper.legacyEscapeText(step.replayMsg.requestBody, true)})]",
                        "response-header": "[(${helper.legacyEscapeText(step.replayMsg.responseHeader, true)})]",
                        "response-body": "[(${helper.legacyEscapeText(step.replayMsg.responseBody, true)})]"
                    }
                }[/th:block]
            ]
        }[/th:block]
    ][/th:block][#th:block th:if="${reportData.isIncludeSection('statistics')}"],
    "statistics":{ [#th:block th:each="stat, statState: ${helper.getGlobalStats('')}"][#th:block th:if="${! statState.first}"],[/th:block]
        [[${stat.key}]]: [[${stat.value}]]
        [/th:block]
    }[/th:block][#th:block th:with="progress=${reportData.reportObjects.get('automation.progress')}" th:if="${reportData.isIncludeSection('afstate')}" ],
    "afPlanErrors": [[#th:block th:if="${progress && progress.errors}"][#th:block th:each="error, errorState: ${progress.errors}"][#th:block th:if="${! errorState.first}"],[/th:block]
        [[${error}]][/th:block][/th:block]
    ],
    "afPlanWarns": [[#th:block th:if="${progress && progress.warnings}"][#th:block th:each="warn, warnState: ${progress.warnings}"][#th:block th:if="${! warnState.first}"],[/th:block]
        [[${warn}]][/th:block][/th:block]
    ][/th:block]
}

