From 01c1876f979fb7307abff17ad1979496220cc2a9 Mon Sep 17 00:00:00 2001 From: Eoin O'Brien Date: Thu, 5 Nov 2020 02:17:57 +0000 Subject: [PATCH] Add $schema to outputted files --- src/__snapshots__/index.test.ts.snap | 2 ++ src/axe-raw-sarif-converter.ts | 2 ++ src/sarif-converter.ts | 2 ++ src/test-resources/basic-axe-v3.2.2.sarif | 1 + src/test-resources/basic-axe-v3.3.2.sarif | 1 + src/test-resources/basic-axe-v3.4.1.sarif | 3 ++- src/test-resources/basic-axe-v3.4.2.sarif | 3 ++- src/test-resources/basic-axe-v3.5.1.sarif | 3 ++- src/test-resources/basic-axe-v3.5.2.sarif | 3 ++- src/test-resources/basic-axe-v3.5.3.sarif | 3 ++- src/test-resources/basic-axe-v3.5.4.sarif | 3 ++- src/test-resources/basic-axe-v3.5.5.sarif | 3 ++- src/test-resources/basic-axe-v4.0.1.sarif | 3 ++- src/test-resources/basic-axe-v4.0.2.sarif | 3 ++- src/test-resources/w3citylights-axe-v3.2.2.sarif | 3 ++- src/test-resources/w3citylights-axe-v3.3.2.sarif | 1 + src/test-resources/w3citylights-axe-v3.4.1.sarif | 3 ++- src/test-resources/w3citylights-axe-v3.4.2.sarif | 3 ++- src/test-resources/w3citylights-axe-v3.5.1.sarif | 3 ++- src/test-resources/w3citylights-axe-v3.5.2.sarif | 3 ++- src/test-resources/w3citylights-axe-v3.5.3.sarif | 3 ++- src/test-resources/w3citylights-axe-v3.5.4.sarif | 3 ++- src/test-resources/w3citylights-axe-v3.5.5.sarif | 3 ++- src/test-resources/w3citylights-axe-v4.0.1.sarif | 3 ++- src/test-resources/w3citylights-axe-v4.0.2.sarif | 3 ++- 25 files changed, 47 insertions(+), 19 deletions(-) diff --git a/src/__snapshots__/index.test.ts.snap b/src/__snapshots__/index.test.ts.snap index 325f0838..ceccc57c 100644 --- a/src/__snapshots__/index.test.ts.snap +++ b/src/__snapshots__/index.test.ts.snap @@ -2,6 +2,7 @@ exports[`public convertAxeToSarif API converts minimal axe v2 input with no results to the pinned minimal SARIF output 1`] = ` Object { + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": Array [ Object { "artifacts": Array [ @@ -709,6 +710,7 @@ Object { exports[`public sarifReporter API converts empty/minimal axe rawObject input with no results to the pinned minimal SARIF output 1`] = ` Object { + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": Array [ Object { "artifacts": Array [ diff --git a/src/axe-raw-sarif-converter.ts b/src/axe-raw-sarif-converter.ts index 98db6a17..9bd35015 100644 --- a/src/axe-raw-sarif-converter.ts +++ b/src/axe-raw-sarif-converter.ts @@ -55,6 +55,8 @@ export class AxeRawSarifConverter { ): Sarif.Log { return { version: '2.1.0', + $schema: + 'https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json', runs: [this.convertRun(results, converterOptions, environmentData)], }; } diff --git a/src/sarif-converter.ts b/src/sarif-converter.ts index 2118d3ef..e6428562 100644 --- a/src/sarif-converter.ts +++ b/src/sarif-converter.ts @@ -54,6 +54,8 @@ export class SarifConverter { ): Sarif.Log { return { version: '2.1.0', + $schema: + 'https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json', runs: [this.convertRun(results, options)], }; } diff --git a/src/test-resources/basic-axe-v3.2.2.sarif b/src/test-resources/basic-axe-v3.2.2.sarif index eadb47d2..69bd5a2a 100644 --- a/src/test-resources/basic-axe-v3.2.2.sarif +++ b/src/test-resources/basic-axe-v3.2.2.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { diff --git a/src/test-resources/basic-axe-v3.3.2.sarif b/src/test-resources/basic-axe-v3.3.2.sarif index 1d43dc7d..85e47fd5 100644 --- a/src/test-resources/basic-axe-v3.3.2.sarif +++ b/src/test-resources/basic-axe-v3.3.2.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { diff --git a/src/test-resources/basic-axe-v3.4.1.sarif b/src/test-resources/basic-axe-v3.4.1.sarif index 1de24dfb..437b4fc9 100644 --- a/src/test-resources/basic-axe-v3.4.1.sarif +++ b/src/test-resources/basic-axe-v3.4.1.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -762,4 +763,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/basic-axe-v3.4.2.sarif b/src/test-resources/basic-axe-v3.4.2.sarif index a3d2ac9a..579b3fe1 100644 --- a/src/test-resources/basic-axe-v3.4.2.sarif +++ b/src/test-resources/basic-axe-v3.4.2.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -762,4 +763,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/basic-axe-v3.5.1.sarif b/src/test-resources/basic-axe-v3.5.1.sarif index 59d87ea0..3dd2751a 100644 --- a/src/test-resources/basic-axe-v3.5.1.sarif +++ b/src/test-resources/basic-axe-v3.5.1.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -762,4 +763,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/basic-axe-v3.5.2.sarif b/src/test-resources/basic-axe-v3.5.2.sarif index f8dc7a9f..e02fe461 100644 --- a/src/test-resources/basic-axe-v3.5.2.sarif +++ b/src/test-resources/basic-axe-v3.5.2.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -762,4 +763,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/basic-axe-v3.5.3.sarif b/src/test-resources/basic-axe-v3.5.3.sarif index bb4fa0f5..798ae00a 100644 --- a/src/test-resources/basic-axe-v3.5.3.sarif +++ b/src/test-resources/basic-axe-v3.5.3.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -762,4 +763,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/basic-axe-v3.5.4.sarif b/src/test-resources/basic-axe-v3.5.4.sarif index b604aa4d..14b35dcd 100644 --- a/src/test-resources/basic-axe-v3.5.4.sarif +++ b/src/test-resources/basic-axe-v3.5.4.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -762,4 +763,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/basic-axe-v3.5.5.sarif b/src/test-resources/basic-axe-v3.5.5.sarif index abed500b..e94df587 100644 --- a/src/test-resources/basic-axe-v3.5.5.sarif +++ b/src/test-resources/basic-axe-v3.5.5.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -762,4 +763,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/basic-axe-v4.0.1.sarif b/src/test-resources/basic-axe-v4.0.1.sarif index 9c188140..6875724f 100644 --- a/src/test-resources/basic-axe-v4.0.1.sarif +++ b/src/test-resources/basic-axe-v4.0.1.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -762,4 +763,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/basic-axe-v4.0.2.sarif b/src/test-resources/basic-axe-v4.0.2.sarif index 42d87322..1415a65b 100644 --- a/src/test-resources/basic-axe-v4.0.2.sarif +++ b/src/test-resources/basic-axe-v4.0.2.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -762,4 +763,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/w3citylights-axe-v3.2.2.sarif b/src/test-resources/w3citylights-axe-v3.2.2.sarif index ca7b74a1..483b79e2 100644 --- a/src/test-resources/w3citylights-axe-v3.2.2.sarif +++ b/src/test-resources/w3citylights-axe-v3.2.2.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -14212,4 +14213,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/w3citylights-axe-v3.3.2.sarif b/src/test-resources/w3citylights-axe-v3.3.2.sarif index c332e0df..9833650c 100644 --- a/src/test-resources/w3citylights-axe-v3.3.2.sarif +++ b/src/test-resources/w3citylights-axe-v3.3.2.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { diff --git a/src/test-resources/w3citylights-axe-v3.4.1.sarif b/src/test-resources/w3citylights-axe-v3.4.1.sarif index c8d54a1e..cec04983 100644 --- a/src/test-resources/w3citylights-axe-v3.4.1.sarif +++ b/src/test-resources/w3citylights-axe-v3.4.1.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -13299,4 +13300,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/w3citylights-axe-v3.4.2.sarif b/src/test-resources/w3citylights-axe-v3.4.2.sarif index a7825631..474b5a80 100644 --- a/src/test-resources/w3citylights-axe-v3.4.2.sarif +++ b/src/test-resources/w3citylights-axe-v3.4.2.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -12891,4 +12892,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/w3citylights-axe-v3.5.1.sarif b/src/test-resources/w3citylights-axe-v3.5.1.sarif index 686dc92d..99e21f31 100644 --- a/src/test-resources/w3citylights-axe-v3.5.1.sarif +++ b/src/test-resources/w3citylights-axe-v3.5.1.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -25477,4 +25478,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/w3citylights-axe-v3.5.2.sarif b/src/test-resources/w3citylights-axe-v3.5.2.sarif index bf24d250..2689d421 100644 --- a/src/test-resources/w3citylights-axe-v3.5.2.sarif +++ b/src/test-resources/w3citylights-axe-v3.5.2.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -25505,4 +25506,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/w3citylights-axe-v3.5.3.sarif b/src/test-resources/w3citylights-axe-v3.5.3.sarif index c65c4a1b..2508aba9 100644 --- a/src/test-resources/w3citylights-axe-v3.5.3.sarif +++ b/src/test-resources/w3citylights-axe-v3.5.3.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -25505,4 +25506,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/w3citylights-axe-v3.5.4.sarif b/src/test-resources/w3citylights-axe-v3.5.4.sarif index 471f7359..91ff5d42 100644 --- a/src/test-resources/w3citylights-axe-v3.5.4.sarif +++ b/src/test-resources/w3citylights-axe-v3.5.4.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -25505,4 +25506,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/w3citylights-axe-v3.5.5.sarif b/src/test-resources/w3citylights-axe-v3.5.5.sarif index 00935826..b74d7d41 100644 --- a/src/test-resources/w3citylights-axe-v3.5.5.sarif +++ b/src/test-resources/w3citylights-axe-v3.5.5.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -25505,4 +25506,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/w3citylights-axe-v4.0.1.sarif b/src/test-resources/w3citylights-axe-v4.0.1.sarif index eb0eb378..60578b11 100644 --- a/src/test-resources/w3citylights-axe-v4.0.1.sarif +++ b/src/test-resources/w3citylights-axe-v4.0.1.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -25505,4 +25506,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/test-resources/w3citylights-axe-v4.0.2.sarif b/src/test-resources/w3citylights-axe-v4.0.2.sarif index df1e55c6..d076ac5f 100644 --- a/src/test-resources/w3citylights-axe-v4.0.2.sarif +++ b/src/test-resources/w3citylights-axe-v4.0.2.sarif @@ -1,5 +1,6 @@ { "version": "2.1.0", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "conversion": { @@ -25505,4 +25506,4 @@ ] } ] -} \ No newline at end of file +}