snyk-partners / fortify-snyk-parser

4 stars 5 forks source link

fix: allow an array of projects in json #1

Closed mikomraz closed 4 years ago

mikomraz commented 4 years ago

when running snyk test --json with --all-sub-projects we get an list of scan results objects.

The change introduced here is to check whether the scan.json start with a [, and if so parse the file as a list of scan results object, and if not parse it straight as a results object.

previously we were assuming it will be:

{
  "vulnerabilities": [],
  "ok": true,
  "dependencyCount": 0,
  ...

now we accept this too:

[
  {
    "vulnerabilities": [],
    "ok": true,
    "dependencyCount": 0,
   ....

vs.