Skip to content

SARIF example files on "SARIF support for code scanning" are not valid JSON #46095

Description

@HardMax71

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageDo not begin working on this issue until triaged by the team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions