File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 2525#include < set>
2626#include < sstream>
2727
28+ static const char sarifVersion[] = " 2.1.0" ;
29+ static const char sarifSchema[] = " https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json" ;
30+
2831void SarifReport::addFinding (ErrorMessage msg)
2932{
3033 mFindings .push_back (std::move (msg));
@@ -180,14 +183,14 @@ std::string SarifReport::serialize(std::string productName) const
180183 version.erase (version.find (' ' ), std::string::npos);
181184
182185 picojson::object doc;
183- doc[" $schema" ] = picojson::value (" https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json " );
186+ doc[" $schema" ] = picojson::value (sarifSchema );
184187 doc[" runs" ] = serializeRuns (productName, version);
185188
186189 // Insert "version" property at the start.
187190 // From SARIF specification (https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790730):
188191 // Although the order in which properties appear in a JSON object value is not semantically significant, the version property SHOULD appear first.
189192
190- return " {\n \" version\" : \" 2.1.0 \" ," + picojson::value (doc).serialize (true ).substr (1 );
193+ return " {\n \" version\" : \" " + sarifVersion + " \" ," + picojson::value (doc).serialize (true ).substr (1 );
191194}
192195
193196std::string SarifReport::sarifSeverity (const ErrorMessage& errmsg)
You can’t perform that action at this time.
0 commit comments