The two examples under "SARIF output file examples" on https://docs.github.com/en/code-security/reference/code-scanning/sarif-files/sarif-support ("Example with minimum required properties" and "Relative URI Guidance for SARIF Producers") share a rule object that is not valid JSON:
{
"id": "R01"
...
"properties" : {
...
"security-severity" : "9.8",
}
}
It has no comma after "id": "R01", a bare ... line, and a trailing comma after "9.8". Copying either example into a SARIF file fails to parse (json.loads stops with "Expecting ',' delimiter: line 12 column 23"). With the comma added, the ... line removed and the trailing comma dropped, both examples parse and validate against the SARIF 2.1.0 schema they reference. The third example on the page is already valid.
The two examples under "SARIF output file examples" on https://docs.github.com/en/code-security/reference/code-scanning/sarif-files/sarif-support ("Example with minimum required properties" and "Relative URI Guidance for SARIF Producers") share a rule object that is not valid JSON:
{ "id": "R01" ... "properties" : { ... "security-severity" : "9.8", } }It has no comma after
"id": "R01", a bare...line, and a trailing comma after"9.8". Copying either example into a SARIF file fails to parse (json.loadsstops with "Expecting ',' delimiter: line 12 column 23"). With the comma added, the...line removed and the trailing comma dropped, both examples parse and validate against the SARIF 2.1.0 schema they reference. The third example on the page is already valid.