diff mbox series

[pushed:,r15-4035] diagnostics: support SARIF 2.2 output, undocumented for now [PR116301]

Message ID 20241003021331.3157425-1-dmalcolm@redhat.com
State New
Headers show
Series [pushed:,r15-4035] diagnostics: support SARIF 2.2 output, undocumented for now [PR116301] | expand

Commit Message

David Malcolm Oct. 3, 2024, 2:13 a.m. UTC
GCC currently supports outputting SARIF v2.1.0

Version 2.2 of the SARIF spec is not yet official, but the draft has
already gained features we might might want to use.

This patch extends the SARIF output code to accept a enum sarif_version
parameter internally, representing 2.1.0 or a prerelease of 2.2

The patch updates the SARIF output selftests so that they are run for
all such versions.

I hope to expose this "properly" via the mechanism described
in comment #13 of PR116613.  In the meantime, the patch adds a new
  -fdiagnostics-format=sarif-file-2.2-prerelease
for use by the DejaGnu testsuite, deliberately left undocumented for
now.

The copy of the 2.2 draft schema in the testsuite was downloaded from
https://raw.githubusercontent.com/oasis-tcs/sarif-spec/refs/tags/2.2-prerelease-2024-08-08/sarif-2.2/schema/sarif-2-2.schema.json

The patch adds support for capturing related locations within an ICE
notification for SARIF 2.2 onwards, thus capturing "include chain"
information for SARIF-based reports of ICEs that occur within a
header; see https://github.com/oasis-tcs/sarif-spec/issues/540

The patch does *not* add support for the "scannedFile" role, leaving it
to followup work; see https://github.com/oasis-tcs/sarif-spec/issues/459

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r15-4035-gcaef7002b74af6.

gcc/ChangeLog:
	PR other/116301
	* common.opt (sarif-file-2.2-prerelease): New value for
	-fdiagnostics-format=.
	* diagnostic-format-sarif.cc
	(sarif_location_manager::sarif_location_manager): Move
	initialization of m_related_locations_arr here from sarif_result's
	ctor.
	(sarif_location_manager::add_related_location): Implement for
	base class, taking sarif_result's implementation.  Add "builder"
	param.
	(sarif_location_manager::m_related_locations_arr): Move here from
	class sarif_result.
	(class sarif_result): Move m_related_locations_arr field and
	add_related_location vfunc to class sarif_location_manager.
	(sarif_builder::get_version): New accessor.
	(sarif_builder::m_version): New field.
	(sarif_invocation::add_notification_for_ice): Call
	process_worklist on the notification for SARIF 2.2 and later.
	(sarif_location_manager::process_worklist_item): Pass builder to
	calls to add_related_location.
	(sarif_result::on_nested_diagnostic): Likewise.
	(sarif_result::on_diagram): Likewise.
	(sarif_ice_notification::add_related_location): Add builder param.
	For SARIF 2.2 and later chain up to base class impl so that
	notifications get related locations.
	(sarif_builder::sarif_builder): Add "version" param.
	(SARIF_SCHEMA): Delete in favor of...
	(sarif_version_to_url): New function.
	(SARIF_VERSION): Delete in favor of...
	(sarif_version_to_property): New function.
	(make_top_level_object): Update to use m_version for "$schema" and
	"version".
	(sarif_output_format::sarif_output_format): Add "version" param.
	(sarif_stream_output_format::sarif_stream_output_format):
	Likewise.
	(sarif_file_output_format::sarif_file_output_format): Likewise.
	(diagnostic_output_format_init_sarif_stderr): Likewise.
	(diagnostic_output_format_init_sarif_file): Likewise.
	(diagnostic_output_format_init_sarif_stream): Likewise.
	(selftest::test_sarif_diagnostic_context): Likewise.
	(selftest::test_make_location_object): Likewise.
	(selftest::test_simple_log): Likewise.  Update schema and version
	tests accordingly.
	(selftest::test_simple_log_2): Add "version" param.
	(selftest::test_message_with_embedded_link): Likewise.
	(selftest::run_tests_per_version): New, based on the
	for_each_line_table_case calls in...
	(selftest::diagnostic_format_sarif_cc_tests): Add loop over sarif
	versions.  Replace for_each_line_table_case calls with one
	call to run_tests_per_version.
	* diagnostic-format-sarif.h: Include "diagnostic-format.h".
	(enum class sarif_version): New.
	(diagnostic_output_format_init_sarif_stderr): Move to here from
	diagnostic-format.h.  Add "version" param.
	(diagnostic_output_format_init_sarif_file): Likewise.
	(diagnostic_output_format_init_sarif_stream): Likewise.
	* diagnostic-format.h: Include "diagnostic.h".
	(diagnostic_output_format_init_sarif_stderr): Move from here to
	diagnostic-format-sarif.h.
	* diagnostic.cc: Define INCLUDE_MEMORY.
	Include "diagnostic-format-sarif.h".
	(diagnostic_output_format_init): Pass sarif_version::v2_1_0 to
	existing SARIF options.
	Add case DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE_2_2_PRERELEASE.
	* diagnostic.h (enum diagnostics_output_format): Add
	DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE_2_2_PRERELEASE.

gcc/testsuite/ChangeLog:
	PR other/116301
	* gcc.dg/plugin/crash-test-ice-in-header-sarif-2.1.c: New test.
	* gcc.dg/plugin/crash-test-ice-in-header-sarif-2.2.c: New test.
	* gcc.dg/plugin/crash-test-ice-in-header-sarif-2_1.py: Support
	script for new test.
	* gcc.dg/plugin/crash-test-ice-in-header-sarif-2_2.py: Likewise.
	* gcc.dg/plugin/crash-test-ice-in-header.h: New header.
	* gcc.dg/plugin/plugin.exp: Add the new tests.
	* lib/sarif-schema-2.2-prerelease-2024-08-08.json: New schema
	file.
	* lib/scansarif.exp (verify-sarif-file): Add optional argument for
	specifying which version of the schema to validate against,
	supporting "2.1" and "2.2", defaulting to the former.
	Update the test name to capture the version of the schema tested
	against.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
 gcc/common.opt                                |    4 +
 gcc/diagnostic-format-sarif.cc                |  232 +-
 gcc/diagnostic-format-sarif.h                 |   30 +
 gcc/diagnostic-format.h                       |   19 +-
 gcc/diagnostic.cc                             |   15 +-
 gcc/diagnostic.h                              |    6 +-
 .../crash-test-ice-in-header-sarif-2.1.c      |   13 +
 .../crash-test-ice-in-header-sarif-2.2.c      |   13 +
 .../crash-test-ice-in-header-sarif-2_1.py     |   61 +
 .../crash-test-ice-in-header-sarif-2_2.py     |   69 +
 .../gcc.dg/plugin/crash-test-ice-in-header.h  |    6 +
 gcc/testsuite/gcc.dg/plugin/plugin.exp        |    2 +
 ...arif-schema-2.2-prerelease-2024-08-08.json | 3058 +++++++++++++++++
 gcc/testsuite/lib/scansarif.exp               |   23 +-
 14 files changed, 3459 insertions(+), 92 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2.1.c
 create mode 100644 gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2.2.c
 create mode 100644 gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2_1.py
 create mode 100644 gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2_2.py
 create mode 100644 gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header.h
 create mode 100644 gcc/testsuite/lib/sarif-schema-2.2-prerelease-2024-08-08.json
diff mbox series

Patch

diff --git a/gcc/common.opt b/gcc/common.opt
index d270e524ff45..12b25ff486de 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1487,6 +1487,10 @@  Enum(diagnostics_output_format) String(sarif-stderr) Value(DIAGNOSTICS_OUTPUT_FO
 EnumValue
 Enum(diagnostics_output_format) String(sarif-file) Value(DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE)
 
+EnumValue
+Enum(diagnostics_output_format) String(sarif-file-2.2-prerelease) Value(DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE_2_2_PRERELEASE)
+; undocumented
+
 fdiagnostics-parseable-fixits
 Common Var(flag_diagnostics_parseable_fixits)
 Print fix-it hints in machine-readable form.
diff --git a/gcc/diagnostic-format-sarif.cc b/gcc/diagnostic-format-sarif.cc
index ec3e7f9a2d88..aeba9f9ceef3 100644
--- a/gcc/diagnostic-format-sarif.cc
+++ b/gcc/diagnostic-format-sarif.cc
@@ -347,7 +347,8 @@  public:
   };
 
   sarif_location_manager ()
-  : m_next_location_id (0)
+  : m_related_locations_arr (nullptr),
+    m_next_location_id (0)
   {
   }
 
@@ -357,7 +358,8 @@  public:
   }
 
   virtual void
-  add_related_location (std::unique_ptr<sarif_location> location_obj) = 0;
+  add_related_location (std::unique_ptr<sarif_location> location_obj,
+			sarif_builder &builder);
 
   void
   add_relationship_to_worklist (sarif_location &location_obj,
@@ -371,6 +373,7 @@  public:
   process_worklist_item (sarif_builder &builder,
 			 const worklist_item &item);
 private:
+  json::array *m_related_locations_arr; // borrowed
   unsigned m_next_location_id;
 
   std::list<worklist_item> m_worklist;
@@ -387,8 +390,7 @@  class sarif_result : public sarif_location_manager
 {
 public:
   sarif_result (unsigned idx_within_parent)
-    : m_related_locations_arr (nullptr),
-      m_idx_within_parent (idx_within_parent)
+  : m_idx_within_parent (idx_within_parent)
   {}
 
   unsigned get_index_within_parent () const { return m_idx_within_parent; }
@@ -400,12 +402,7 @@  public:
   void on_diagram (const diagnostic_diagram &diagram,
 		   sarif_builder &builder);
 
-  void
-  add_related_location (std::unique_ptr<sarif_location> location_obj)
-    final override;
-
 private:
-  json::array *m_related_locations_arr; // borrowed
   const unsigned m_idx_within_parent;
 };
 
@@ -584,8 +581,8 @@  public:
 			  sarif_builder &builder);
 
   void
-  add_related_location (std::unique_ptr<sarif_location> location_obj)
-    final override;
+  add_related_location (std::unique_ptr<sarif_location> location_obj,
+			sarif_builder &builder) final override;
 };
 
 /* Abstract base class for use when making an  "artifactContent"
@@ -648,7 +645,8 @@  public:
   sarif_builder (diagnostic_context &context,
 		 const line_maps *line_maps,
 		 const char *main_input_filename_,
-		 bool formatted);
+		 bool formatted,
+		 enum sarif_version version);
   ~sarif_builder ();
 
   void on_report_diagnostic (const diagnostic_info &diagnostic,
@@ -696,6 +694,7 @@  public:
   diagnostic_context &get_context () const { return m_context; }
   pretty_printer *get_printer () const { return m_printer; }
   token_printer &get_token_printer () { return m_token_printer; }
+  enum sarif_version get_version () const { return m_version; }
 
 private:
   class sarif_token_printer : public token_printer
@@ -806,6 +805,7 @@  private:
   pretty_printer *m_printer;
   const line_maps *m_line_maps;
   sarif_token_printer m_token_printer;
+  enum sarif_version m_version;
 
   /* The JSON object for the invocation object.  */
   std::unique_ptr<sarif_invocation> m_invocation_obj;
@@ -889,8 +889,16 @@  sarif_invocation::add_notification_for_ice (const diagnostic_info &diagnostic,
 {
   m_success = false;
 
+  auto notification
+    = ::make_unique<sarif_ice_notification> (diagnostic, builder);
+
+  /* Support for related locations within a notification was added
+     in SARIF 2.2; see https://github.com/oasis-tcs/sarif-spec/issues/540  */
+  if (builder.get_version () >= sarif_version::v2_2_prerelease_2024_08_08)
+    notification->process_worklist (builder);
+
   m_notifications_arr->append<sarif_ice_notification>
-    (::make_unique<sarif_ice_notification> (diagnostic, builder));
+    (std::move (notification));
 }
 
 void
@@ -1009,6 +1017,26 @@  sarif_artifact::populate_roles ()
 
 /* class sarif_location_manager : public sarif_object.  */
 
+/* Base implementation of sarif_location_manager::add_related_location vfunc.
+
+   Add LOCATION_OBJ to this object's "relatedLocations" array,
+   creating it if it doesn't yet exist.  */
+
+void
+sarif_location_manager::
+add_related_location (std::unique_ptr<sarif_location> location_obj,
+		      sarif_builder &)
+{
+  if (!m_related_locations_arr)
+    {
+      m_related_locations_arr = new json::array ();
+      /* Give ownership of m_related_locations_arr to json::object;
+	 keep a borrowed ptr.  */
+      set ("relatedLocations", m_related_locations_arr);
+    }
+  m_related_locations_arr->append (std::move (location_obj));
+}
+
 void
 sarif_location_manager::
 add_relationship_to_worklist (sarif_location &location_obj,
@@ -1063,7 +1091,7 @@  sarif_location_manager::process_worklist_item (sarif_builder &builder,
 		   item.m_where,
 		   diagnostic_artifact_role::scanned_file);
 	    includer_loc_obj = new_loc_obj.get ();
-	    add_related_location (std::move (new_loc_obj));
+	    add_related_location (std::move (new_loc_obj), builder);
 	    auto kv
 	      = std::pair<location_t, sarif_location *> (item.m_where,
 							 includer_loc_obj);
@@ -1095,7 +1123,7 @@  sarif_location_manager::process_worklist_item (sarif_builder &builder,
 		   item.m_where,
 		   diagnostic_artifact_role::scanned_file);
 	    secondary_loc_obj = new_loc_obj.get ();
-	    add_related_location (std::move (new_loc_obj));
+	    add_related_location (std::move (new_loc_obj), builder);
 	    auto kv
 	      = std::pair<location_t, sarif_location *> (item.m_where,
 							 secondary_loc_obj);
@@ -1135,7 +1163,7 @@  sarif_result::on_nested_diagnostic (const diagnostic_info &diagnostic,
   pp_clear_output_area (builder.get_printer ());
   location_obj->set<sarif_message> ("message", std::move (message_obj));
 
-  add_related_location (std::move (location_obj));
+  add_related_location (std::move (location_obj), builder);
 }
 
 /* Handle diagrams that occur within a diagnostic group.
@@ -1152,27 +1180,7 @@  sarif_result::on_diagram (const diagnostic_diagram &diagram,
   auto message_obj = builder.make_message_object_for_diagram (diagram);
   location_obj->set<sarif_message> ("message", std::move (message_obj));
 
-  add_related_location (std::move (location_obj));
-}
-
-/* Implementation of sarif_location_manager::add_related_location vfunc
-   for result objects.
-
-   Add LOCATION_OBJ to this result's "relatedLocations" array,
-   creating it if it doesn't yet exist.  */
-
-void
-sarif_result::
-add_related_location (std::unique_ptr<sarif_location> location_obj)
-{
-  if (!m_related_locations_arr)
-    {
-      m_related_locations_arr = new json::array ();
-      /* Give ownership of m_related_locations_arr to json::object;
-	 keep a borrowed ptr.  */
-      set ("relatedLocations", m_related_locations_arr);
-    }
-  m_related_locations_arr->append (std::move (location_obj));
+  add_related_location (std::move (location_obj), builder);
 }
 
 /* class sarif_location : public sarif_object.  */
@@ -1326,11 +1334,15 @@  sarif_ice_notification (const diagnostic_info &diagnostic,
 
 void
 sarif_ice_notification::
-add_related_location (std::unique_ptr<sarif_location> location_obj)
+add_related_location (std::unique_ptr<sarif_location> location_obj,
+		      sarif_builder &builder)
 {
-  /* TODO(SARIF 2.2): see https://github.com/oasis-tcs/sarif-spec/issues/540
-     For now, discard all related locations within a notification.  */
-  location_obj = nullptr;
+  /* Support for related locations within a notification was added
+     in SARIF 2.2; see https://github.com/oasis-tcs/sarif-spec/issues/540  */
+  if (builder.get_version () >= sarif_version::v2_2_prerelease_2024_08_08)
+    sarif_location_manager::add_related_location (std::move (location_obj),
+						  builder);
+  /* Otherwise implicitly discard LOCATION_OBJ.  */
 }
 
 /* class sarif_location_relationship : public sarif_object.  */
@@ -1470,11 +1482,13 @@  sarif_thread_flow::add_location ()
 sarif_builder::sarif_builder (diagnostic_context &context,
 			      const line_maps *line_maps,
 			      const char *main_input_filename_,
-			      bool formatted)
+			      bool formatted,
+			      enum sarif_version version)
 : m_context (context),
   m_printer (context.m_printer),
   m_line_maps (line_maps),
   m_token_printer (*this),
+  m_version (version),
   m_invocation_obj
     (::make_unique<sarif_invocation> (*this,
 				      context.get_original_argv ())),
@@ -2639,8 +2653,41 @@  sarif_builder::make_multiformat_message_string (const char *msg) const
   return message_obj;
 }
 
-#define SARIF_SCHEMA "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json"
-#define SARIF_VERSION "2.1.0"
+/* Convert VERSION to a value for the "$schema" property
+   of a "sarifLog" object (SARIF v2.1.0 section 3.13.3).  */
+
+static const char *
+sarif_version_to_url (enum sarif_version version)
+{
+  switch (version)
+    {
+    default:
+      gcc_unreachable ();
+    case sarif_version::v2_1_0:
+      return "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json";
+    case sarif_version::v2_2_prerelease_2024_08_08:
+      return "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/refs/tags/2.2-prerelease-2024-08-08/sarif-2.2/schema/sarif-2-2.schema.json";
+    }
+}
+
+/* Convert VERSION to a value for the "version" property
+   of a "sarifLog" object (SARIF v2.1.0 section 3.13.2).  */
+
+static const char *
+sarif_version_to_property (enum sarif_version version)
+{
+  switch (version)
+    {
+    default:
+      gcc_unreachable ();
+    case sarif_version::v2_1_0:
+      return "2.1.0";
+    case sarif_version::v2_2_prerelease_2024_08_08:
+      /* I would have used "2.2-prerelease-2024-08-08",
+	 but the schema only accepts "2.2".  */
+      return "2.2";
+    }
+}
 
 /* Make a top-level "sarifLog" object (SARIF v2.1.0 section 3.13).  */
 
@@ -2652,10 +2699,10 @@  make_top_level_object (std::unique_ptr<sarif_invocation> invocation_obj,
   auto log_obj = ::make_unique<sarif_log> ();
 
   /* "$schema" property (SARIF v2.1.0 section 3.13.3) .  */
-  log_obj->set_string ("$schema", SARIF_SCHEMA);
+  log_obj->set_string ("$schema", sarif_version_to_url (m_version));
 
   /* "version" property (SARIF v2.1.0 section 3.13.2).  */
-  log_obj->set_string ("version", SARIF_VERSION);
+  log_obj->set_string ("version", sarif_version_to_property (m_version));
 
   /* "runs" property (SARIF v2.1.0 section 3.13.4).  */
   auto run_arr = ::make_unique<json::array> ();
@@ -3149,9 +3196,10 @@  protected:
   sarif_output_format (diagnostic_context &context,
 		       const line_maps *line_maps,
 		       const char *main_input_filename_,
-		       bool formatted)
+		       bool formatted,
+		       enum sarif_version version)
   : diagnostic_output_format (context),
-    m_builder (context, line_maps, main_input_filename_, formatted)
+    m_builder (context, line_maps, main_input_filename_, formatted, version)
   {}
 
   sarif_builder m_builder;
@@ -3164,8 +3212,10 @@  public:
 			      const line_maps *line_maps,
 			      const char *main_input_filename_,
 			      bool formatted,
+			      enum sarif_version version,
 			      FILE *stream)
-  : sarif_output_format (context, line_maps, main_input_filename_, formatted),
+  : sarif_output_format (context, line_maps, main_input_filename_,
+			 formatted, version),
     m_stream (stream)
   {
   }
@@ -3188,8 +3238,10 @@  public:
 			    const line_maps *line_maps,
 			    const char *main_input_filename_,
 			    bool formatted,
+			    enum sarif_version version,
 			    const char *base_file_name)
-  : sarif_output_format (context, line_maps, main_input_filename_, formatted),
+  : sarif_output_format (context, line_maps, main_input_filename_,
+			 formatted, version),
     m_base_file_name (xstrdup (base_file_name))
   {
   }
@@ -3364,7 +3416,8 @@  void
 diagnostic_output_format_init_sarif_stderr (diagnostic_context &context,
 					    const line_maps *line_maps,
 					    const char *main_input_filename_,
-					    bool formatted)
+					    bool formatted,
+					    enum sarif_version version)
 {
   gcc_assert (line_maps);
   diagnostic_output_format_init_sarif
@@ -3373,6 +3426,7 @@  diagnostic_output_format_init_sarif_stderr (diagnostic_context &context,
 						line_maps,
 						main_input_filename_,
 						formatted,
+						version,
 						stderr));
 }
 
@@ -3384,6 +3438,7 @@  diagnostic_output_format_init_sarif_file (diagnostic_context &context,
 					  const line_maps *line_maps,
 					  const char *main_input_filename_,
 					  bool formatted,
+					  enum sarif_version version,
 					  const char *base_file_name)
 {
   gcc_assert (line_maps);
@@ -3393,6 +3448,7 @@  diagnostic_output_format_init_sarif_file (diagnostic_context &context,
 					      line_maps,
 					      main_input_filename_,
 					      formatted,
+					      version,
 					      base_file_name));
 }
 
@@ -3403,6 +3459,7 @@  diagnostic_output_format_init_sarif_stream (diagnostic_context &context,
 					    const line_maps *line_maps,
 					    const char *main_input_filename_,
 					    bool formatted,
+					    enum sarif_version version,
 					    FILE *stream)
 {
   gcc_assert (line_maps);
@@ -3412,6 +3469,7 @@  diagnostic_output_format_init_sarif_stream (diagnostic_context &context,
 						line_maps,
 						main_input_filename_,
 						formatted,
+						version,
 						stream));
 }
 
@@ -3426,12 +3484,14 @@  namespace selftest {
 class test_sarif_diagnostic_context : public test_diagnostic_context
 {
 public:
-  test_sarif_diagnostic_context (const char *main_input_filename)
+  test_sarif_diagnostic_context (const char *main_input_filename,
+				 enum sarif_version version)
   {
     auto format = ::make_unique<buffered_output_format> (*this,
 							 line_table,
 							 main_input_filename,
-							 true);
+							 true,
+							 version);
     m_format = format.get (); // borrowed
     diagnostic_output_format_init_sarif (*this, std::move (format));
   }
@@ -3448,8 +3508,10 @@  private:
     buffered_output_format (diagnostic_context &context,
 			    const line_maps *line_maps,
 			    const char *main_input_filename_,
-			    bool formatted)
-    : sarif_output_format (context, line_maps, main_input_filename_, formatted)
+			    bool formatted,
+			    enum sarif_version version)
+    : sarif_output_format (context, line_maps, main_input_filename_,
+			   formatted, version)
     {
     }
     bool machine_readable_stderr_p () const final override
@@ -3469,7 +3531,8 @@  private:
    with labels and escape-on-output.  */
 
 static void
-test_make_location_object (const line_table_case &case_)
+test_make_location_object (const line_table_case &case_,
+			   enum sarif_version version)
 {
   diagnostic_show_locus_fixture_one_liner_utf8 f (case_);
   location_t line_end = linemap_position_for_column (line_table, 31);
@@ -3480,7 +3543,7 @@  test_make_location_object (const line_table_case &case_)
 
   test_diagnostic_context dc;
 
-  sarif_builder builder (dc, line_table, "MAIN_INPUT_FILENAME", true);
+  sarif_builder builder (dc, line_table, "MAIN_INPUT_FILENAME", true, version);
 
   /* These "columns" are byte offsets, whereas later on the columns
      in the generated SARIF use sarif_builder::get_sarif_column and
@@ -3591,9 +3654,9 @@  test_make_location_object (const line_table_case &case_)
    Verify various basic properties. */
 
 static void
-test_simple_log ()
+test_simple_log (enum sarif_version version)
 {
-  test_sarif_diagnostic_context dc ("MAIN_INPUT_FILENAME");
+  test_sarif_diagnostic_context dc ("MAIN_INPUT_FILENAME", version);
 
   rich_location richloc (line_table, UNKNOWN_LOCATION);
   dc.report (DK_ERROR, richloc, nullptr, 0, "this is a test: %i", 42);
@@ -3602,8 +3665,10 @@  test_simple_log ()
 
   // 3.13 sarifLog:
   auto log = log_ptr.get ();
-  ASSERT_JSON_STRING_PROPERTY_EQ (log, "$schema", SARIF_SCHEMA); // 3.13.3
-  ASSERT_JSON_STRING_PROPERTY_EQ (log, "version", SARIF_VERSION); // 3.13.2
+  ASSERT_JSON_STRING_PROPERTY_EQ (log, "$schema",
+				  sarif_version_to_url (version));
+  ASSERT_JSON_STRING_PROPERTY_EQ (log, "version",
+				  sarif_version_to_property (version));
 
   auto runs = EXPECT_JSON_OBJECT_WITH_ARRAY_PROPERTY (log, "runs"); // 3.13.4
   ASSERT_EQ (runs->size (), 1);
@@ -3706,7 +3771,8 @@  test_simple_log ()
 /* As above, but with a "real" location_t.  */
 
 static void
-test_simple_log_2 (const line_table_case &case_)
+test_simple_log_2 (const line_table_case &case_,
+		   enum sarif_version version)
 {
   auto_fix_quotes fix_quotes;
 
@@ -3721,7 +3787,7 @@  test_simple_log_2 (const line_table_case &case_)
   if (line_end > LINE_MAP_MAX_LOCATION_WITH_COLS)
     return;
 
-  test_sarif_diagnostic_context dc (f.get_filename ());
+  test_sarif_diagnostic_context dc (f.get_filename (), version);
 
   const location_t typo_loc
     = make_location (linemap_position_for_column (line_table, 1),
@@ -3842,11 +3908,11 @@  get_message_from_log (const sarif_log *log)
 /* Tests of messages with embedded links; see SARIF v2.1.0 3.11.6.  */
 
 static void
-test_message_with_embedded_link ()
+test_message_with_embedded_link (enum sarif_version version)
 {
   auto_fix_quotes fix_quotes;
   {
-    test_sarif_diagnostic_context dc ("test.c");
+    test_sarif_diagnostic_context dc ("test.c", version);
     rich_location richloc (line_table, UNKNOWN_LOCATION);
     dc.report (DK_ERROR, richloc, nullptr, 0,
 	       "before %{text%} after",
@@ -3862,7 +3928,7 @@  test_message_with_embedded_link ()
   /* Escaping in message text.
      This is "EXAMPLE 1" from 3.11.6.  */
   {
-    test_sarif_diagnostic_context dc ("test.c");
+    test_sarif_diagnostic_context dc ("test.c", version);
     rich_location richloc (line_table, UNKNOWN_LOCATION);
 
     /* Disable "unquoted sequence of 2 consecutive punctuation
@@ -3902,7 +3968,7 @@  test_message_with_embedded_link ()
       }
     };
 
-    test_sarif_diagnostic_context dc ("test.c");
+    test_sarif_diagnostic_context dc ("test.c", version);
     dc.set_urlifier (new test_urlifier ());
     rich_location richloc (line_table, UNKNOWN_LOCATION);
     dc.report (DK_ERROR, richloc, nullptr, 0,
@@ -3916,15 +3982,39 @@  test_message_with_embedded_link ()
   }
 }
 
+static void
+run_tests_per_version (const line_table_case &case_)
+{
+  for (int version_idx = 0;
+       version_idx < (int)sarif_version::num_versions;
+       ++version_idx)
+    {
+      enum sarif_version version
+	= static_cast<enum sarif_version> (version_idx);
+
+      test_make_location_object (case_, version);
+      test_simple_log_2 (case_, version);
+    }
+}
+
 /* Run all of the selftests within this file.  */
 
 void
 diagnostic_format_sarif_cc_tests ()
 {
-  for_each_line_table_case (test_make_location_object);
-  test_simple_log ();
-  for_each_line_table_case (test_simple_log_2);
-  test_message_with_embedded_link ();
+  for (int version_idx = 0;
+       version_idx < (int)sarif_version::num_versions;
+       ++version_idx)
+    {
+      enum sarif_version version
+	= static_cast<enum sarif_version> (version_idx);
+
+      test_simple_log (version);
+      test_message_with_embedded_link (version);
+    }
+
+  /* Run tests per (line-table-case, SARIF version) pair.  */
+  for_each_line_table_case (run_tests_per_version);
 }
 
 } // namespace selftest
diff --git a/gcc/diagnostic-format-sarif.h b/gcc/diagnostic-format-sarif.h
index 781c3c31e8c4..555ea60a70b4 100644
--- a/gcc/diagnostic-format-sarif.h
+++ b/gcc/diagnostic-format-sarif.h
@@ -22,9 +22,39 @@  along with GCC; see the file COPYING3.  If not see
 #define GCC_DIAGNOSTIC_FORMAT_SARIF_H
 
 #include "json.h"
+#include "diagnostic-format.h"
 
 class logical_location;
 
+enum class sarif_version
+{
+  v2_1_0,
+  v2_2_prerelease_2024_08_08,
+
+  num_versions
+};
+
+extern void
+diagnostic_output_format_init_sarif_stderr (diagnostic_context &context,
+					    const line_maps *line_maps,
+					    const char *main_input_filename_,
+					    bool formatted,
+					    enum sarif_version version);
+extern void
+diagnostic_output_format_init_sarif_file (diagnostic_context &context,
+					  const line_maps *line_maps,
+					  const char *main_input_filename_,
+					  bool formatted,
+					  enum sarif_version version,
+					  const char *base_file_name);
+extern void
+diagnostic_output_format_init_sarif_stream (diagnostic_context &context,
+					    const line_maps *line_maps,
+					    const char *main_input_filename_,
+					    bool formatted,
+					    enum sarif_version version,
+					    FILE *stream);
+
 /* Concrete subclass of json::object for SARIF property bags
    (SARIF v2.1.0 section 3.8).  */
 
diff --git a/gcc/diagnostic-format.h b/gcc/diagnostic-format.h
index fd937ef0e3f9..1fd3fe0c64e8 100644
--- a/gcc/diagnostic-format.h
+++ b/gcc/diagnostic-format.h
@@ -21,6 +21,8 @@  along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_DIAGNOSTIC_FORMAT_H
 #define GCC_DIAGNOSTIC_FORMAT_H
 
+#include "diagnostic.h"
+
 /* Abstract base class for a particular output format for diagnostics;
    each value of -fdiagnostics-output-format= will have its own
    implementation.  */
@@ -71,22 +73,5 @@  extern void
 diagnostic_output_format_init_json_file (diagnostic_context &context,
 					 bool formatted,
 					 const char *base_file_name);
-extern void
-diagnostic_output_format_init_sarif_stderr (diagnostic_context &context,
-					    const line_maps *line_maps,
-					    const char *main_input_filename_,
-					    bool formatted);
-extern void
-diagnostic_output_format_init_sarif_file (diagnostic_context &context,
-					  const line_maps *line_maps,
-					  const char *main_input_filename_,
-					  bool formatted,
-					  const char *base_file_name);
-extern void
-diagnostic_output_format_init_sarif_stream (diagnostic_context &context,
-					    const line_maps *line_maps,
-					    const char *main_input_filename_,
-					    bool formatted,
-					    FILE *stream);
 
 #endif /* ! GCC_DIAGNOSTIC_FORMAT_H */
diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index 618837e1731d..dfedcae58052 100644
--- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.cc
@@ -23,6 +23,7 @@  along with GCC; see the file COPYING3.  If not see
    message module.  */
 
 #include "config.h"
+#define INCLUDE_MEMORY
 #define INCLUDE_VECTOR
 #include "system.h"
 #include "coretypes.h"
@@ -38,6 +39,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "diagnostic-client-data-hooks.h"
 #include "diagnostic-diagram.h"
 #include "diagnostic-format.h"
+#include "diagnostic-format-sarif.h"
 #include "diagnostic-format-text.h"
 #include "edit-context.h"
 #include "selftest.h"
@@ -1597,7 +1599,8 @@  diagnostic_output_format_init (diagnostic_context &context,
       diagnostic_output_format_init_sarif_stderr (context,
 						  line_table,
 						  main_input_filename_,
-						  json_formatting);
+						  json_formatting,
+						  sarif_version::v2_1_0);
       break;
 
     case DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE:
@@ -1605,8 +1608,18 @@  diagnostic_output_format_init (diagnostic_context &context,
 						line_table,
 						main_input_filename_,
 						json_formatting,
+						sarif_version::v2_1_0,
 						base_file_name);
       break;
+    case DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE_2_2_PRERELEASE:
+      diagnostic_output_format_init_sarif_file
+	(context,
+	 line_table,
+	 main_input_filename_,
+	 json_formatting,
+	 sarif_version::v2_2_prerelease_2024_08_08,
+	 base_file_name);
+      break;
     }
 }
 
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index 447e3b183d92..fd056bd87225 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -76,7 +76,11 @@  enum diagnostics_output_format
   DIAGNOSTICS_OUTPUT_FORMAT_SARIF_STDERR,
 
   /* SARIF-based output, to a file.  */
-  DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE
+  DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE,
+
+  /* Undocumented, for use by test suite.
+     SARIF-based output, to a file, using a prerelease of the 2.2 schema.  */
+  DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE_2_2_PRERELEASE
 };
 
 /* An enum for controlling how diagnostic_paths should be printed.  */
diff --git a/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2.1.c b/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2.1.c
new file mode 100644
index 000000000000..823bbe43a1c0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2.1.c
@@ -0,0 +1,13 @@ 
+/* Test of an ICE triggered within a header file with SARIF 2.1  */
+
+/* { dg-do compile } */
+/* { dg-options "-fdiagnostics-format=sarif-file" } */
+/* { dg-additional-options "-fno-report-bug" } */
+
+#include "crash-test-ice-in-header.h"  /* { dg-ice "" } */
+/* { dg-regexp "during GIMPLE pass: crash_test" } */
+
+/* Verify that some JSON was written to a file with the expected name.  */
+/* { dg-final { verify-sarif-file "2.1" } }
+
+   { dg-final { run-sarif-pytest crash-test-ice-in-header-sarif-2.1.c "crash-test-ice-in-header-sarif-2_1.py" } } */
diff --git a/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2.2.c b/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2.2.c
new file mode 100644
index 000000000000..b5328060c394
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2.2.c
@@ -0,0 +1,13 @@ 
+/* Test of an ICE triggered within a header file with SARIF 2.2  */
+
+/* { dg-do compile } */
+/* { dg-options "-fdiagnostics-format=sarif-file-2.2-prerelease" } */
+/* { dg-additional-options "-fno-report-bug" } */
+
+#include "crash-test-ice-in-header.h"  /* { dg-ice "" } */
+/* { dg-regexp "during GIMPLE pass: crash_test" } */
+
+/* Verify that some JSON was written to a file with the expected name.  */
+/* { dg-final { verify-sarif-file "2.2" } }
+
+   { dg-final { run-sarif-pytest crash-test-ice-in-header-sarif-2.2.c "crash-test-ice-in-header-sarif-2_2.py" } } */
diff --git a/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2_1.py b/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2_1.py
new file mode 100644
index 000000000000..223e9a0c6132
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2_1.py
@@ -0,0 +1,61 @@ 
+# We expect a warning with this textual form:
+#
+# | In file included from PATH/crash-test-ice-header-sarif-2.1.c:5:
+# | PATH/crash-test-ice-in-header-sarif-2.1.c: In function 'test_inject_ice':
+# | PATH/crash-test-ice-in-header.h:3:22: internal compiler error: I'm sorry Dave, I'm afraid I can't do that
+# |     3 | #define INJECT_ICE() inject_ice ()
+# |       |                      ^~~~~~~~~~~~~
+# | PATH/crash-test-ice-in-header-sarif-2.1.c:9:3: note: in expansion of macro 'INJECT_ICE'
+# |     9 |   INJECT_ICE (); /* { dg-ice "" } */
+# |       |   ^~~~~~~~~~
+
+from sarif import *
+
+import pytest
+
+@pytest.fixture(scope='function', autouse=True)
+def sarif():
+    return sarif_from_env()
+
+def test_basics(sarif):
+    # We expect SARIF 2.1
+    schema = sarif['$schema']
+    assert schema == "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json"
+
+    version = sarif['version']
+    assert version == "2.1.0"
+
+def test_no_result(sarif):
+    # We expect no results in the run
+    runs = sarif['runs']
+    run = runs[0]
+    results = run['results']
+    assert len(results) == 0
+
+def test_notification(sarif):
+    # We expect an execution notification for the ICE in the invocation
+    runs = sarif['runs']
+    run = runs[0]
+
+    invocations = run['invocations']
+    assert len(invocations) == 1
+    invocation = invocations[0]
+
+    assert invocation['executionSuccessful'] == False
+
+    notifications = invocation['toolExecutionNotifications']
+    assert len(notifications) == 1
+
+    notification = notifications[0]
+
+    assert notification['message']['text'] == "I'm sorry Dave, I'm afraid I can't do that"
+    assert notification['level'] == 'error'
+
+    loc0 = notification['locations'][0]
+    assert get_location_artifact_uri(loc0).endswith('crash-test-ice-in-header.h')
+    assert 'inject_ice ();' in get_location_snippet_text(loc0)
+
+    # In SARIF 2.1 and earlier we aren't able to capture the include path
+    # as a related location within the notification
+    assert 'relationships' not in loc0
+    assert 'relatedLocations' not in notification
diff --git a/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2_2.py b/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2_2.py
new file mode 100644
index 000000000000..27c6da9e1f59
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header-sarif-2_2.py
@@ -0,0 +1,69 @@ 
+# We expect a warning with this textual form:
+#
+# | In file included from PATH/crash-test-ice-header-sarif-2.2.c:5:
+# | PATH/crash-test-ice-in-header-sarif-2.2.c: In function 'test_inject_ice':
+# | PATH/crash-test-ice-in-header.h:3:22: internal compiler error: I'm sorry Dave, I'm afraid I can't do that
+# |     3 | #define INJECT_ICE() inject_ice ()
+# |       |                      ^~~~~~~~~~~~~
+# | PATH/crash-test-ice-in-header-sarif-2.2.c:9:3: note: in expansion of macro 'INJECT_ICE'
+# |     9 |   INJECT_ICE (); /* { dg-ice "" } */
+# |       |   ^~~~~~~~~~
+
+from sarif import *
+
+import pytest
+
+@pytest.fixture(scope='function', autouse=True)
+def sarif():
+    return sarif_from_env()
+
+def test_basics(sarif):
+    # We expect SARIF 2.2
+    schema = sarif['$schema']
+    assert schema == "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/refs/tags/2.2-prerelease-2024-08-08/sarif-2.2/schema/sarif-2-2.schema.json"
+
+    version = sarif['version']
+    assert version == "2.2"
+
+def test_no_result(sarif):
+    # We expect no results in the run
+    runs = sarif['runs']
+    run = runs[0]
+    results = run['results']
+    assert len(results) == 0
+
+def test_notification(sarif):
+    # We expect an execution notification for the ICE in the invocation
+    runs = sarif['runs']
+    run = runs[0]
+
+    invocations = run['invocations']
+    assert len(invocations) == 1
+    invocation = invocations[0]
+
+    assert invocation['executionSuccessful'] == False
+
+    notifications = invocation['toolExecutionNotifications']
+    assert len(notifications) == 1
+
+    notification = notifications[0]
+
+    assert notification['message']['text'] == "I'm sorry Dave, I'm afraid I can't do that"
+    assert notification['level'] == 'error'
+
+    loc0 = notification['locations'][0]
+    assert get_location_artifact_uri(loc0).endswith('crash-test-ice-in-header.h')
+    assert 'inject_ice ();' in get_location_snippet_text(loc0)
+
+    # In SARIF 2.2 onwards we should be able to capture the include path
+    # as a related location within the notification
+    assert len(loc0['relationships']) == 1
+    assert loc0['relationships'][0]['kinds'] == ['isIncludedBy']
+
+    assert len(notification['relatedLocations']) == 1
+    rel_loc = notification['relatedLocations'][0]
+
+    assert get_location_artifact_uri(rel_loc).endswith('crash-test-ice-in-header-sarif-2.2.c')
+    assert '#include "crash-test-ice-in-header.h"' in get_location_snippet_text(rel_loc)
+    assert len(rel_loc['relationships']) == 1
+    assert rel_loc['relationships'][0]['kinds'] == ['includes']
diff --git a/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header.h b/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header.h
new file mode 100644
index 000000000000..d2dd1740aba7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/plugin/crash-test-ice-in-header.h
@@ -0,0 +1,6 @@ 
+extern void inject_ice (void);
+
+void test_inject_ice (void)
+{
+  inject_ice ();
+}
diff --git a/gcc/testsuite/gcc.dg/plugin/plugin.exp b/gcc/testsuite/gcc.dg/plugin/plugin.exp
index 8ac1bfa7f77b..0b53e06d8352 100644
--- a/gcc/testsuite/gcc.dg/plugin/plugin.exp
+++ b/gcc/testsuite/gcc.dg/plugin/plugin.exp
@@ -73,6 +73,8 @@  set plugin_test_list [list \
 	  crash-test-ice-stderr.c \
 	  crash-test-write-though-null-stderr.c \
 	  crash-test-ice-sarif.c \
+	  crash-test-ice-in-header-sarif-2.1.c \
+	  crash-test-ice-in-header-sarif-2.2.c \
 	  crash-test-write-though-null-sarif.c } \
     { diagnostic_plugin_xhtml_format.c \
 	  diagnostic-test-xhtml-1.c } \
diff --git a/gcc/testsuite/lib/sarif-schema-2.2-prerelease-2024-08-08.json b/gcc/testsuite/lib/sarif-schema-2.2-prerelease-2024-08-08.json
new file mode 100644
index 000000000000..4fa101b60fd8
--- /dev/null
+++ b/gcc/testsuite/lib/sarif-schema-2.2-prerelease-2024-08-08.json
@@ -0,0 +1,3058 @@ 
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "title": "Static Analysis Results Format (SARIF) Version 2.2 JSON Schema",
+  "$id": "https://docs.oasis-open.org/sarif/sarif/v2.2/schemas/sarif-2.2.schema.json",
+  "description": "Static Analysis Results Format (SARIF) Version 2.2 JSON Schema: a standard format for the output of static analysis tools.",
+  "additionalProperties": false,
+  "type": "object",
+  "properties": {
+    "$schema": {
+      "description": "The URI of the JSON schema corresponding to the version.",
+      "type": "string",
+      "format": "uri"
+    },
+    "version": {
+      "description": "The SARIF format version of this log file.",
+      "enum": [
+        "2.2"
+      ],
+      "type": "string"
+    },
+    "runs": {
+      "description": "The set of runs contained in this log file.",
+      "type": [
+        "array",
+        "null"
+      ],
+      "minItems": 0,
+      "uniqueItems": false,
+      "items": {
+        "$ref": "#/$defs/run"
+      }
+    },
+    "inlineExternalProperties": {
+      "description": "References to external property files that share data between runs.",
+      "type": "array",
+      "minItems": 0,
+      "uniqueItems": true,
+      "items": {
+        "$ref": "#/$defs/externalProperties"
+      }
+    },
+    "guid": {
+      "description": "A stable, unique identifier for the external property file in the form of a GUID.",
+      "$ref": "#/$defs/guid"
+    },
+    "properties": {
+      "description": "Key/value pairs that provide additional information about the log file.",
+      "$ref": "#/$defs/propertyBag"
+    }
+  },
+  "required": [
+    "version",
+    "runs"
+  ],
+  "$defs": {
+    "address": {
+      "description": "A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file).",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "absoluteAddress": {
+          "description": "The address expressed as a byte offset from the start of the addressable region.",
+          "type": "integer",
+          "minimum": -1,
+          "default": -1
+        },
+        "relativeAddress": {
+          "description": "The address expressed as a byte offset from the absolute address of the top-most parent object.",
+          "type": "integer"
+        },
+        "length": {
+          "description": "The number of bytes in this range of addresses.",
+          "type": "integer"
+        },
+        "kind": {
+          "description": "An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values.",
+          "type": "string"
+        },
+        "name": {
+          "description": "A name that is associated with the address, e.g., '.text'.",
+          "type": "string"
+        },
+        "fullyQualifiedName": {
+          "description": "A human-readable fully qualified name that is associated with the address.",
+          "type": "string"
+        },
+        "offsetFromParent": {
+          "description": "The byte offset of this address from the absolute or relative address of the parent object.",
+          "type": "integer"
+        },
+        "index": {
+          "description": "The index within run.addresses of the cached object for this address.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "parentIndex": {
+          "description": "The index within run.addresses of the parent object.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the address.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "artifact": {
+      "description": "A single artifact. In some cases, this artifact might be nested within another artifact.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "description": {
+          "description": "A short description of the artifact.",
+          "$ref": "#/$defs/message"
+        },
+        "location": {
+          "description": "The location of the artifact.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "parentIndex": {
+          "description": "Identifies the index of the immediate parent of the artifact, if this artifact is nested.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "offset": {
+          "description": "The offset in bytes of the artifact within its containing artifact.",
+          "type": "integer",
+          "minimum": 0
+        },
+        "length": {
+          "description": "The length of the artifact in bytes.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "roles": {
+          "description": "The role or roles played by the artifact in the analysis.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "enum": [
+              "analysisTarget",
+              "attachment",
+              "responseFile",
+              "resultFile",
+              "scannedFile",
+              "standardStream",
+              "tracedFile",
+              "unmodified",
+              "modified",
+              "added",
+              "deleted",
+              "renamed",
+              "uncontrolled",
+              "driver",
+              "extension",
+              "translation",
+              "taxonomy",
+              "policy",
+              "referencedOnCommandLine",
+              "memoryContents",
+              "directory",
+              "userSpecifiedConfiguration",
+              "toolSpecifiedConfiguration",
+              "debugOutputFile"
+            ],
+            "type": "string"
+          }
+        },
+        "mimeType": {
+          "description": "The MIME type (RFC 2045) of the artifact.",
+          "type": "string",
+          "pattern": "[^/]+/.+"
+        },
+        "contents": {
+          "description": "The contents of the artifact.",
+          "$ref": "#/$defs/artifactContent"
+        },
+        "encoding": {
+          "description": "Specifies the encoding for an artifact object that refers to a text file.",
+          "type": "string"
+        },
+        "sourceLanguage": {
+          "description": "Specifies the source language for any artifact object that refers to a text file that contains source code.",
+          "type": "string"
+        },
+        "hashes": {
+          "description": "A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function.",
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        },
+        "lastModifiedTimeUtc": {
+          "description": "The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See \"Date/time properties\" in the SARIF spec for the required format.",
+          "type": "string",
+          "format": "date-time"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the artifact.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "artifactChange": {
+      "description": "A change to a single artifact.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "artifactLocation": {
+          "description": "The location of the artifact to change.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "replacements": {
+          "description": "An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'.",
+          "type": "array",
+          "minItems": 1,
+          "uniqueItems": false,
+          "items": {
+            "$ref": "#/$defs/replacement"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the change.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "artifactLocation",
+        "replacements"
+      ]
+    },
+    "artifactContent": {
+      "description": "Represents the contents of an artifact.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "text": {
+          "description": "UTF-8-encoded content from a text artifact.",
+          "type": "string"
+        },
+        "binary": {
+          "description": "MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding.",
+          "type": "string"
+        },
+        "rendered": {
+          "description": "An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region).",
+          "$ref": "#/$defs/multiformatMessageString"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the artifact content.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "artifactLocation": {
+      "description": "Specifies the location of an artifact.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "uri": {
+          "description": "A string containing a valid relative or absolute URI.",
+          "type": "string",
+          "format": "uri-reference"
+        },
+        "uriBaseId": {
+          "description": "A string which indirectly specifies the absolute URI with respect to which a relative URI in the \"uri\" property is interpreted.",
+          "type": "string"
+        },
+        "index": {
+          "description": "The index within the run artifacts array of the artifact object associated with the artifact location.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "description": {
+          "description": "A short description of the artifact location.",
+          "$ref": "#/$defs/message"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the artifact location.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "attachment": {
+      "description": "An artifact relevant to a result.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "description": {
+          "description": "A message describing the role played by the attachment.",
+          "$ref": "#/$defs/message"
+        },
+        "artifactLocation": {
+          "description": "The location of the attachment.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "regions": {
+          "description": "An array of regions of interest within the attachment.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/region"
+          }
+        },
+        "rectangles": {
+          "description": "An array of rectangles specifying areas of interest within the image.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/rectangle"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the attachment.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "artifactLocation"
+      ]
+    },
+    "codeFlow": {
+      "description": "A set of threadFlows which together describe a pattern of code execution relevant to detecting a result.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "message": {
+          "description": "A message relevant to the code flow.",
+          "$ref": "#/$defs/message"
+        },
+        "threadFlows": {
+          "description": "An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.",
+          "type": "array",
+          "minItems": 1,
+          "uniqueItems": false,
+          "items": {
+            "$ref": "#/$defs/threadFlow"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the code flow.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "threadFlows"
+      ]
+    },
+    "configurationOverride": {
+      "description": "Information about how a specific rule or notification was reconfigured at runtime.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "configuration": {
+          "description": "Specifies how the rule or notification was configured during the scan.",
+          "$ref": "#/$defs/reportingConfiguration"
+        },
+        "descriptor": {
+          "description": "A reference used to locate the descriptor whose configuration was overridden.",
+          "$ref": "#/$defs/reportingDescriptorReference"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the configuration override.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "configuration",
+        "descriptor"
+      ]
+    },
+    "conversion": {
+      "description": "Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "tool": {
+          "description": "A tool object that describes the converter.",
+          "$ref": "#/$defs/tool"
+        },
+        "invocation": {
+          "description": "An invocation object that describes the invocation of the converter.",
+          "$ref": "#/$defs/invocation"
+        },
+        "analysisToolLogFiles": {
+          "description": "The locations of the analysis tool's per-run log files.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/artifactLocation"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the conversion.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "tool"
+      ]
+    },
+    "edge": {
+      "description": "Represents a directed edge in a graph.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "id": {
+          "description": "A string that uniquely identifies the edge within its graph.",
+          "type": "string"
+        },
+        "label": {
+          "description": "A short description of the edge.",
+          "$ref": "#/$defs/message"
+        },
+        "sourceNodeId": {
+          "description": "Identifies the source node (the node at which the edge starts).",
+          "type": "string"
+        },
+        "targetNodeId": {
+          "description": "Identifies the target node (the node at which the edge ends).",
+          "type": "string"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the edge.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "id",
+        "sourceNodeId",
+        "targetNodeId"
+      ]
+    },
+    "edgeTraversal": {
+      "description": "Represents the traversal of a single edge during a graph traversal.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "edgeId": {
+          "description": "Identifies the edge being traversed.",
+          "type": "string"
+        },
+        "message": {
+          "description": "A message to display to the user as the edge is traversed.",
+          "$ref": "#/$defs/message"
+        },
+        "finalState": {
+          "description": "The values of relevant expressions after the edge has been traversed.",
+          "type": "object",
+          "additionalProperties": {
+            "$ref": "#/$defs/multiformatMessageString"
+          }
+        },
+        "stepOverEdgeCount": {
+          "description": "The number of edge traversals necessary to return from a nested graph.",
+          "type": "integer",
+          "minimum": 0
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the edge traversal.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "edgeId"
+      ]
+    },
+    "exception": {
+      "description": "Describes a runtime exception encountered during the execution of an analysis tool.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "kind": {
+          "type": "string",
+          "description": "A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal."
+        },
+        "message": {
+          "description": "A message that describes the exception.",
+          "type": "string"
+        },
+        "stack": {
+          "description": "The sequence of function calls leading to the exception.",
+          "$ref": "#/$defs/stack"
+        },
+        "innerExceptions": {
+          "description": "An array of exception objects each of which is considered a cause of this exception.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/exception"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the exception.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "externalProperties": {
+      "description": "The top-level element of an external property file.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "schema": {
+          "description": "The URI of the JSON schema corresponding to the version of the external property file format.",
+          "type": "string",
+          "format": "uri"
+        },
+        "version": {
+          "description": "The SARIF format version of this external properties object.",
+          "enum": [
+            "2.1.0"
+          ],
+          "type": "string"
+        },
+        "guid": {
+          "description": "A stable, unique identifier for this external properties object, in the form of a GUID.",
+          "$ref": "#/$defs/guid"
+        },
+        "runGuid": {
+          "description": "A stable, unique identifier for the run associated with this external properties object, in the form of a GUID.",
+          "type": "string",
+          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
+        },
+        "conversion": {
+          "description": "A conversion object that will be merged with a separate run.",
+          "$ref": "#/$defs/conversion"
+        },
+        "graphs": {
+          "description": "An array of graph objects that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "default": [],
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/graph"
+          }
+        },
+        "externalizedProperties": {
+          "description": "Key/value pairs that provide additional information that will be merged with a separate run.",
+          "$ref": "#/$defs/propertyBag"
+        },
+        "artifacts": {
+          "description": "An array of artifact objects that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/artifact"
+          }
+        },
+        "invocations": {
+          "description": "Describes the invocation of the analysis tool that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/invocation"
+          }
+        },
+        "logicalLocations": {
+          "description": "An array of logical locations such as namespaces, types or functions that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/logicalLocation"
+          }
+        },
+        "threadFlowLocations": {
+          "description": "An array of threadFlowLocation objects that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/threadFlowLocation"
+          }
+        },
+        "results": {
+          "description": "An array of result objects that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/result"
+          }
+        },
+        "taxonomies": {
+          "description": "Tool taxonomies that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/toolComponent"
+          }
+        },
+        "driver": {
+          "description": "The analysis tool object that will be merged with a separate run.",
+          "$ref": "#/$defs/toolComponent"
+        },
+        "extensions": {
+          "description": "Tool extensions that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/toolComponent"
+          }
+        },
+        "policies": {
+          "description": "Tool policies that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/toolComponent"
+          }
+        },
+        "translations": {
+          "description": "Tool translations that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/toolComponent"
+          }
+        },
+        "addresses": {
+          "description": "Addresses that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/address"
+          }
+        },
+        "webRequests": {
+          "description": "Requests that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/webRequest"
+          }
+        },
+        "webResponses": {
+          "description": "Responses that will be merged with a separate run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/webResponse"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the external properties.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "externalPropertyFileReference": {
+      "description": "Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "location": {
+          "description": "The location of the external property file.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "guid": {
+          "description": "A stable, unique identifier for the external property file in the form of a GUID.",
+          "$ref": "#/$defs/guid"
+        },
+        "itemCount": {
+          "description": "A non-negative integer specifying the number of items contained in the external property file.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the external property file.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "anyOf": [
+        {
+          "required": [
+            "location"
+          ]
+        },
+        {
+          "required": [
+            "guid"
+          ]
+        }
+      ]
+    },
+    "externalPropertyFileReferences": {
+      "description": "References to external property files that should be inlined with the content of a root log file.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "conversion": {
+          "description": "An external property file containing a run.conversion object to be merged with the root log file.",
+          "$ref": "#/$defs/externalPropertyFileReference"
+        },
+        "graphs": {
+          "description": "An array of external property files containing a run.graphs object to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "externalizedProperties": {
+          "description": "An external property file containing a run.properties object to be merged with the root log file.",
+          "$ref": "#/$defs/externalPropertyFileReference"
+        },
+        "artifacts": {
+          "description": "An array of external property files containing run.artifacts arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "invocations": {
+          "description": "An array of external property files containing run.invocations arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "logicalLocations": {
+          "description": "An array of external property files containing run.logicalLocations arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "threadFlowLocations": {
+          "description": "An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "results": {
+          "description": "An array of external property files containing run.results arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "taxonomies": {
+          "description": "An array of external property files containing run.taxonomies arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "addresses": {
+          "description": "An array of external property files containing run.addresses arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "driver": {
+          "description": "An external property file containing a run.driver object to be merged with the root log file.",
+          "$ref": "#/$defs/externalPropertyFileReference"
+        },
+        "extensions": {
+          "description": "An array of external property files containing run.extensions arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "policies": {
+          "description": "An array of external property files containing run.policies arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "translations": {
+          "description": "An array of external property files containing run.translations arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "webRequests": {
+          "description": "An array of external property files containing run.requests arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "webResponses": {
+          "description": "An array of external property files containing run.responses arrays to be merged with the root log file.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/externalPropertyFileReference"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the external property files.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "fix": {
+      "description": "A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "description": {
+          "description": "A message that describes the proposed fix, enabling viewers to present the proposed change to an end user.",
+          "$ref": "#/$defs/message"
+        },
+        "artifactChanges": {
+          "description": "One or more artifact changes that comprise a fix for a result.",
+          "type": "array",
+          "minItems": 1,
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/artifactChange"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the fix.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "artifactChanges"
+      ]
+    },
+    "graph": {
+      "description": "A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call graph).",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "description": {
+          "description": "A description of the graph.",
+          "$ref": "#/$defs/message"
+        },
+        "nodes": {
+          "description": "An array of node objects representing the nodes of the graph.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/node"
+          }
+        },
+        "edges": {
+          "description": "An array of edge objects representing the edges of the graph.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/edge"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the graph.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "graphTraversal": {
+      "description": "Represents a path through a graph.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "runGraphIndex": {
+          "description": "The index within the run.graphs to be associated with the result.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "resultGraphIndex": {
+          "description": "The index within the result.graphs to be associated with the result.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "description": {
+          "description": "A description of this graph traversal.",
+          "$ref": "#/$defs/message"
+        },
+        "initialState": {
+          "description": "Values of relevant expressions at the start of the graph traversal that may change during graph traversal.",
+          "type": "object",
+          "additionalProperties": {
+            "$ref": "#/$defs/multiformatMessageString"
+          }
+        },
+        "immutableState": {
+          "description": "Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.",
+          "type": "object",
+          "additionalProperties": {
+            "$ref": "#/$defs/multiformatMessageString"
+          }
+        },
+        "edgeTraversals": {
+          "description": "The sequences of edges traversed by this graph traversal.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/edgeTraversal"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the graph traversal.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "oneOf": [
+        {
+          "required": [
+            "runGraphIndex"
+          ]
+        },
+        {
+          "required": [
+            "resultGraphIndex"
+          ]
+        }
+      ]
+    },
+    "guid": {
+      "description": "A stable, unique identifier for many entities in the form of a GUID.",
+      "type": "string",
+      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
+    },
+    "invocation": {
+      "description": "The runtime environment of the analysis tool run.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "commandLine": {
+          "description": "The command line used to invoke the tool.",
+          "type": "string"
+        },
+        "arguments": {
+          "description": "An array of strings, containing in order the command line arguments passed to the tool from the operating system.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "items": {
+            "type": "string"
+          }
+        },
+        "responseFiles": {
+          "description": "The locations of any response files specified on the tool's command line.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/artifactLocation"
+          }
+        },
+        "startTimeUtc": {
+          "description": "The Coordinated Universal Time (UTC) date and time at which the invocation started. See \"Date/time properties\" in the SARIF spec for the required format.",
+          "type": "string",
+          "format": "date-time"
+        },
+        "endTimeUtc": {
+          "description": "The Coordinated Universal Time (UTC) date and time at which the invocation ended. See \"Date/time properties\" in the SARIF spec for the required format.",
+          "type": "string",
+          "format": "date-time"
+        },
+        "exitCode": {
+          "description": "The process exit code.",
+          "type": "integer"
+        },
+        "ruleConfigurationOverrides": {
+          "description": "An array of configurationOverride objects that describe rules related runtime overrides.",
+          "type": "array",
+          "minItems": 0,
+          "default": [],
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/configurationOverride"
+          }
+        },
+        "notificationConfigurationOverrides": {
+          "description": "An array of configurationOverride objects that describe notifications related runtime overrides.",
+          "type": "array",
+          "minItems": 0,
+          "default": [],
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/configurationOverride"
+          }
+        },
+        "toolExecutionNotifications": {
+          "description": "A list of runtime conditions detected by the tool during the analysis.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/notification"
+          }
+        },
+        "toolConfigurationNotifications": {
+          "description": "A list of conditions detected by the tool that are relevant to the tool's configuration.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/notification"
+          }
+        },
+        "exitCodeDescription": {
+          "description": "The reason for the process exit.",
+          "type": "string"
+        },
+        "exitSignalName": {
+          "description": "The name of the signal that caused the process to exit.",
+          "type": "string"
+        },
+        "exitSignalNumber": {
+          "description": "The numeric value of the signal that caused the process to exit.",
+          "type": "integer"
+        },
+        "processStartFailureMessage": {
+          "description": "The reason given by the operating system that the process failed to start.",
+          "type": "string"
+        },
+        "executionSuccessful": {
+          "description": "Specifies whether the tool's execution completed successfully.",
+          "type": "boolean"
+        },
+        "machine": {
+          "description": "The machine on which the invocation occurred.",
+          "type": "string"
+        },
+        "account": {
+          "description": "The account under which the invocation occurred.",
+          "type": "string"
+        },
+        "processId": {
+          "description": "The id of the process in which the invocation occurred.",
+          "type": "integer"
+        },
+        "executableLocation": {
+          "description": "An absolute URI specifying the location of the executable that was invoked.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "workingDirectory": {
+          "description": "The working directory for the invocation.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "environmentVariables": {
+          "description": "The environment variables associated with the analysis tool process, expressed as key/value pairs.",
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        },
+        "stdin": {
+          "description": "A file containing the standard input stream to the process that was invoked.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "stdout": {
+          "description": "A file containing the standard output stream from the process that was invoked.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "stderr": {
+          "description": "A file containing the standard error stream from the process that was invoked.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "stdoutStderr": {
+          "description": "A file containing the interleaved standard output and standard error stream from the process that was invoked.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the invocation.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "executionSuccessful"
+      ]
+    },
+    "language": {
+      "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).",
+      "type": "string",
+      "default": "en-US",
+      "pattern": "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$"
+    },
+    "location": {
+      "description": "A location within a programming artifact.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "id": {
+          "description": "Value that distinguishes this location from all other locations within a single result object.",
+          "type": "integer",
+          "minimum": -1,
+          "default": -1
+        },
+        "physicalLocation": {
+          "description": "Identifies the artifact and region.",
+          "$ref": "#/$defs/physicalLocation"
+        },
+        "logicalLocations": {
+          "description": "The logical locations associated with the result.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/logicalLocation"
+          }
+        },
+        "message": {
+          "description": "A message relevant to the location.",
+          "$ref": "#/$defs/message"
+        },
+        "annotations": {
+          "description": "A set of regions relevant to the location.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/region"
+          }
+        },
+        "relationships": {
+          "description": "An array of objects that describe relationships between this location and others.",
+          "type": "array",
+          "default": [],
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/locationRelationship"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the location.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "locationRelationship": {
+      "description": "Information about the relation of one location to another.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "target": {
+          "description": "A reference to the related location.",
+          "type": "integer",
+          "minimum": 0
+        },
+        "kinds": {
+          "description": "A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'.",
+          "type": "array",
+          "default": [
+            "relevant"
+          ],
+          "uniqueItems": true,
+          "items": {
+            "type": "string"
+          }
+        },
+        "description": {
+          "description": "A description of the location relationship.",
+          "$ref": "#/$defs/message"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the location relationship.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "target"
+      ]
+    },
+    "logicalLocation": {
+      "description": "A logical location of a construct that produced a result.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "name": {
+          "description": "Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.",
+          "type": "string"
+        },
+        "index": {
+          "description": "The index within the logical locations array.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "fullyQualifiedName": {
+          "description": "The human-readable fully qualified name of the logical location.",
+          "type": "string"
+        },
+        "decoratedName": {
+          "description": "The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.",
+          "type": "string"
+        },
+        "parentIndex": {
+          "description": "Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "kind": {
+          "description": "The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct.",
+          "type": "string"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the logical location.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "message": {
+      "description": "Encapsulates a message intended to be read by the end user.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "text": {
+          "description": "A plain text message string.",
+          "type": "string"
+        },
+        "markdown": {
+          "description": "A Markdown message string.",
+          "type": "string"
+        },
+        "id": {
+          "description": "The identifier for this message.",
+          "type": "string"
+        },
+        "arguments": {
+          "description": "An array of strings to substitute into the message string.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "type": "string"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the message.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "anyOf": [
+        {
+          "required": [
+            "text"
+          ]
+        },
+        {
+          "required": [
+            "id"
+          ]
+        }
+      ]
+    },
+    "multiformatMessageString": {
+      "description": "A message string or message format string rendered in multiple formats.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "text": {
+          "description": "A plain text message string or format string.",
+          "type": "string"
+        },
+        "markdown": {
+          "description": "A Markdown message string or format string.",
+          "type": "string"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the message.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "text"
+      ]
+    },
+    "node": {
+      "description": "Represents a node in a graph.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "id": {
+          "description": "A string that uniquely identifies the node within its graph.",
+          "type": "string"
+        },
+        "label": {
+          "description": "A short description of the node.",
+          "$ref": "#/$defs/message"
+        },
+        "location": {
+          "description": "A code location associated with the node.",
+          "$ref": "#/$defs/location"
+        },
+        "children": {
+          "description": "Array of child nodes.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/node"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the node.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "id"
+      ]
+    },
+    "notification": {
+      "description": "Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "locations": {
+          "description": "The locations relevant to this notification.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/location"
+          }
+        },
+        "message": {
+          "description": "A message that describes the condition that was encountered.",
+          "$ref": "#/$defs/message"
+        },
+        "level": {
+          "description": "A value specifying the severity level of the notification.",
+          "default": "warning",
+          "enum": [
+            "none",
+            "note",
+            "warning",
+            "error"
+          ],
+          "type": "string"
+        },
+        "threadId": {
+          "description": "The thread identifier of the code that generated the notification.",
+          "type": "integer"
+        },
+        "timeUtc": {
+          "description": "The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification.",
+          "type": "string",
+          "format": "date-time"
+        },
+        "exception": {
+          "description": "The runtime exception, if any, relevant to this notification.",
+          "$ref": "#/$defs/exception"
+        },
+        "relatedLocations": {
+          "description": "A set of locations relevant to this notification.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/location"
+          }
+        },
+        "descriptor": {
+          "description": "A reference used to locate the descriptor relevant to this notification.",
+          "$ref": "#/$defs/reportingDescriptorReference"
+        },
+        "associatedRule": {
+          "description": "A reference used to locate the rule descriptor associated with this notification.",
+          "$ref": "#/$defs/reportingDescriptorReference"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the notification.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "message"
+      ]
+    },
+    "physicalLocation": {
+      "description": "A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "address": {
+          "description": "The address of the location.",
+          "$ref": "#/$defs/address"
+        },
+        "artifactLocation": {
+          "description": "The location of the artifact.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "region": {
+          "description": "Specifies a portion of the artifact.",
+          "$ref": "#/$defs/region"
+        },
+        "contextRegion": {
+          "description": "Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region.",
+          "$ref": "#/$defs/region"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the physical location.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "anyOf": [
+        {
+          "required": [
+            "address"
+          ]
+        },
+        {
+          "required": [
+            "artifactLocation"
+          ]
+        }
+      ]
+    },
+    "propertyBag": {
+      "description": "Key/value pairs that provide additional information about the object.",
+      "type": "object",
+      "additionalProperties": true,
+      "properties": {
+        "tags": {
+          "description": "A set of distinct strings that provide additional information.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "type": "string"
+          }
+        }
+      }
+    },
+    "rectangle": {
+      "description": "An area within an image.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "top": {
+          "description": "The Y coordinate of the top edge of the rectangle, measured in the image's natural units.",
+          "type": "number"
+        },
+        "left": {
+          "description": "The X coordinate of the left edge of the rectangle, measured in the image's natural units.",
+          "type": "number"
+        },
+        "bottom": {
+          "description": "The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units.",
+          "type": "number"
+        },
+        "right": {
+          "description": "The X coordinate of the right edge of the rectangle, measured in the image's natural units.",
+          "type": "number"
+        },
+        "message": {
+          "description": "A message relevant to the rectangle.",
+          "$ref": "#/$defs/message"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the rectangle.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "region": {
+      "description": "A region within an artifact where a result was detected.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "startLine": {
+          "description": "The line number of the first character in the region.",
+          "type": "integer",
+          "minimum": 1
+        },
+        "startColumn": {
+          "description": "The column number of the first character in the region.",
+          "type": "integer",
+          "minimum": 1
+        },
+        "endLine": {
+          "description": "The line number of the last character in the region.",
+          "type": "integer",
+          "minimum": 1
+        },
+        "endColumn": {
+          "description": "The column number of the character following the end of the region.",
+          "type": "integer",
+          "minimum": 1
+        },
+        "charOffset": {
+          "description": "The zero-based offset from the beginning of the artifact of the first character in the region.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "charLength": {
+          "description": "The length of the region in characters.",
+          "type": "integer",
+          "minimum": 0
+        },
+        "byteOffset": {
+          "description": "The zero-based offset from the beginning of the artifact of the first byte in the region.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "byteLength": {
+          "description": "The length of the region in bytes.",
+          "type": "integer",
+          "minimum": 0
+        },
+        "snippet": {
+          "description": "The portion of the artifact contents within the specified region.",
+          "$ref": "#/$defs/artifactContent"
+        },
+        "message": {
+          "description": "A message relevant to the region.",
+          "$ref": "#/$defs/message"
+        },
+        "sourceLanguage": {
+          "description": "Specifies the source language, if any, of the portion of the artifact specified by the region object.",
+          "type": "string"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the region.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "anyOf": [
+        {
+          "required": [
+            "startLine"
+          ]
+        },
+        {
+          "required": [
+            "charOffset"
+          ]
+        },
+        {
+          "required": [
+            "byteOffset"
+          ]
+        }
+      ]
+    },
+    "replacement": {
+      "description": "The replacement of a single region of an artifact.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "deletedRegion": {
+          "description": "The region of the artifact to delete.",
+          "$ref": "#/$defs/region"
+        },
+        "insertedContent": {
+          "description": "The content to insert at the location specified by the 'deletedRegion' property.",
+          "$ref": "#/$defs/artifactContent"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the replacement.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "deletedRegion"
+      ]
+    },
+    "reportingDescriptor": {
+      "description": "Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "id": {
+          "description": "A stable, opaque identifier for the report.",
+          "type": "string"
+        },
+        "deprecatedIds": {
+          "description": "An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "type": "string"
+          }
+        },
+        "guid": {
+          "description": "A unique identifier for the reporting descriptor in the form of a GUID.",
+          "$ref": "#/$defs/guid"
+        },
+        "deprecatedGuids": {
+          "description": "An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "type": "string",
+            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
+          }
+        },
+        "name": {
+          "description": "A report identifier that is understandable to an end user.",
+          "type": "string"
+        },
+        "deprecatedNames": {
+          "description": "An array of readable identifiers by which this report was known in some previous version of the analysis tool.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "type": "string"
+          }
+        },
+        "shortDescription": {
+          "description": "A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text.",
+          "$ref": "#/$defs/multiformatMessageString"
+        },
+        "fullDescription": {
+          "description": "A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.",
+          "$ref": "#/$defs/multiformatMessageString"
+        },
+        "messageStrings": {
+          "description": "A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.",
+          "type": "object",
+          "additionalProperties": {
+            "$ref": "#/$defs/multiformatMessageString"
+          }
+        },
+        "defaultConfiguration": {
+          "description": "Default reporting configuration information.",
+          "$ref": "#/$defs/reportingConfiguration"
+        },
+        "helpUri": {
+          "description": "A URI where the primary documentation for the report can be found.",
+          "type": "string",
+          "format": "uri"
+        },
+        "help": {
+          "description": "Provides the primary documentation for the report, useful when there is no online documentation.",
+          "$ref": "#/$defs/multiformatMessageString"
+        },
+        "relationships": {
+          "description": "An array of objects that describe relationships between this reporting descriptor and others.",
+          "type": "array",
+          "default": [],
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/reportingDescriptorRelationship"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the report.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "id"
+      ]
+    },
+    "reportingConfiguration": {
+      "description": "Information about a rule or notification that can be configured at runtime.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "enabled": {
+          "description": "Specifies whether the report may be produced during the scan.",
+          "type": "boolean",
+          "default": true
+        },
+        "level": {
+          "description": "Specifies the failure level for the report.",
+          "default": "warning",
+          "enum": [
+            "none",
+            "note",
+            "warning",
+            "error"
+          ],
+          "type": "string"
+        },
+        "rank": {
+          "description": "Specifies the relative priority of the report. Used for analysis output only.",
+          "type": "number",
+          "default": -1.0,
+          "minimum": -1.0,
+          "maximum": 100.0
+        },
+        "parameters": {
+          "description": "Contains configuration information specific to a report.",
+          "$ref": "#/$defs/propertyBag"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the reporting configuration.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "reportingDescriptorReference": {
+      "description": "Information about how to locate a relevant reporting descriptor.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "id": {
+          "description": "The id of the descriptor.",
+          "type": "string"
+        },
+        "index": {
+          "description": "The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "guid": {
+          "description": "A guid that uniquely identifies the descriptor.",
+          "$ref": "#/$defs/guid"
+        },
+        "toolComponent": {
+          "description": "A reference used to locate the toolComponent associated with the descriptor.",
+          "$ref": "#/$defs/toolComponentReference"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the reporting descriptor reference.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "anyOf": [
+        {
+          "required": [
+            "index"
+          ]
+        },
+        {
+          "required": [
+            "guid"
+          ]
+        },
+        {
+          "required": [
+            "id"
+          ]
+        }
+      ]
+    },
+    "reportingDescriptorRelationship": {
+      "description": "Information about the relation of one reporting descriptor to another.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "target": {
+          "description": "A reference to the related reporting descriptor.",
+          "$ref": "#/$defs/reportingDescriptorReference"
+        },
+        "kinds": {
+          "description": "A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'.",
+          "type": "array",
+          "default": [
+            "relevant"
+          ],
+          "uniqueItems": true,
+          "items": {
+            "type": "string"
+          }
+        },
+        "description": {
+          "description": "A description of the reporting descriptor relationship.",
+          "$ref": "#/$defs/message"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the reporting descriptor reference.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "target"
+      ]
+    },
+    "result": {
+      "description": "A result produced by an analysis tool.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "ruleId": {
+          "description": "The stable, unique identifier of the rule, if any, to which this result is relevant.",
+          "type": "string"
+        },
+        "ruleIndex": {
+          "description": "The index within the tool component rules array of the rule object associated with this result.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "rule": {
+          "description": "A reference used to locate the rule descriptor relevant to this result.",
+          "$ref": "#/$defs/reportingDescriptorReference"
+        },
+        "kind": {
+          "description": "A value that categorizes results by evaluation state.",
+          "default": "fail",
+          "enum": [
+            "notApplicable",
+            "pass",
+            "fail",
+            "review",
+            "open",
+            "informational"
+          ],
+          "type": "string"
+        },
+        "level": {
+          "description": "A value specifying the severity level of the result.",
+          "default": "warning",
+          "enum": [
+            "none",
+            "note",
+            "warning",
+            "error"
+          ],
+          "type": "string"
+        },
+        "message": {
+          "description": "A message that describes the result. The first sentence of the message only will be displayed when visible space is limited.",
+          "$ref": "#/$defs/message"
+        },
+        "analysisTarget": {
+          "description": "Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "locations": {
+          "description": "The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/location"
+          }
+        },
+        "guid": {
+          "description": "A stable, unique identifier for the result in the form of a GUID.",
+          "$ref": "#/$defs/guid"
+        },
+        "correlationGuid": {
+          "description": "A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID.",
+          "type": "string",
+          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
+        },
+        "occurrenceCount": {
+          "description": "A positive integer specifying the number of times this logically unique result was observed in this run.",
+          "type": "integer",
+          "minimum": 1
+        },
+        "partialFingerprints": {
+          "description": "A set of strings that contribute to the stable, unique identity of the result.",
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        },
+        "fingerprints": {
+          "description": "A set of strings each of which individually defines a stable, unique identity for the result.",
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        },
+        "stacks": {
+          "description": "An array of 'stack' objects relevant to the result.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/stack"
+          }
+        },
+        "codeFlows": {
+          "description": "An array of 'codeFlow' objects relevant to the result.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/codeFlow"
+          }
+        },
+        "graphs": {
+          "description": "An array of zero or more unique graph objects associated with the result.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/graph"
+          }
+        },
+        "graphTraversals": {
+          "description": "An array of one or more unique 'graphTraversal' objects.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/graphTraversal"
+          }
+        },
+        "relatedLocations": {
+          "description": "A set of locations relevant to this result.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/location"
+          }
+        },
+        "suppressions": {
+          "description": "A set of suppressions relevant to this result.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/suppression"
+          }
+        },
+        "baselineState": {
+          "description": "The state of a result relative to a baseline of a previous run.",
+          "enum": [
+            "new",
+            "unchanged",
+            "updated",
+            "absent"
+          ],
+          "type": "string"
+        },
+        "rank": {
+          "description": "A number representing the priority or importance of the result.",
+          "type": "number",
+          "default": -1.0,
+          "minimum": -1.0,
+          "maximum": 100.0
+        },
+        "attachments": {
+          "description": "A set of artifacts relevant to the result.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/attachment"
+          }
+        },
+        "hostedViewerUri": {
+          "description": "An absolute URI at which the result can be viewed.",
+          "type": "string",
+          "format": "uri"
+        },
+        "workItemUris": {
+          "description": "The URIs of the work items associated with this result.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "type": "string",
+            "format": "uri"
+          }
+        },
+        "provenance": {
+          "description": "Information about how and when the result was detected.",
+          "$ref": "#/$defs/resultProvenance"
+        },
+        "fixes": {
+          "description": "An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/fix"
+          }
+        },
+        "taxa": {
+          "description": "An array of references to taxonomy reporting descriptors that are applicable to the result.",
+          "type": "array",
+          "default": [],
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/reportingDescriptorReference"
+          }
+        },
+        "webRequest": {
+          "description": "A web request associated with this result.",
+          "$ref": "#/$defs/webRequest"
+        },
+        "webResponse": {
+          "description": "A web response associated with this result.",
+          "$ref": "#/$defs/webResponse"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the result.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "message"
+      ]
+    },
+    "resultProvenance": {
+      "description": "Contains information about how and when a result was detected.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "firstDetectionTimeUtc": {
+          "description": "The Coordinated Universal Time (UTC) date and time at which the result was first detected. See \"Date/time properties\" in the SARIF spec for the required format.",
+          "type": "string",
+          "format": "date-time"
+        },
+        "lastDetectionTimeUtc": {
+          "description": "The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See \"Date/time properties\" in the SARIF spec for the required format.",
+          "type": "string",
+          "format": "date-time"
+        },
+        "firstDetectionRunGuid": {
+          "description": "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected.",
+          "type": "string",
+          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
+        },
+        "lastDetectionRunGuid": {
+          "description": "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected.",
+          "type": "string",
+          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
+        },
+        "invocationIndex": {
+          "description": "The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "conversionSources": {
+          "description": "An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/physicalLocation"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the result.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "run": {
+      "description": "Describes a single run of an analysis tool, and contains the reported output of that run.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "tool": {
+          "description": "Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.",
+          "$ref": "#/$defs/tool"
+        },
+        "invocations": {
+          "description": "Describes the invocation of the analysis tool.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/invocation"
+          }
+        },
+        "conversion": {
+          "description": "A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format.",
+          "$ref": "#/$defs/conversion"
+        },
+        "language": {
+          "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).",
+          "$ref": "#/$defs/language"
+        },
+        "versionControlProvenance": {
+          "description": "Specifies the revision in version control of the artifacts that were scanned.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/versionControlDetails"
+          }
+        },
+        "originalUriBaseIds": {
+          "description": "The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran.",
+          "type": "object",
+          "additionalProperties": {
+            "$ref": "#/$defs/artifactLocation"
+          }
+        },
+        "artifacts": {
+          "description": "An array of artifact objects relevant to the run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/artifact"
+          }
+        },
+        "logicalLocations": {
+          "description": "An array of logical locations such as namespaces, types or functions.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/logicalLocation"
+          }
+        },
+        "graphs": {
+          "description": "An array of zero or more unique graph objects associated with the run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/graph"
+          }
+        },
+        "results": {
+          "description": "The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "items": {
+            "$ref": "#/$defs/result"
+          }
+        },
+        "automationDetails": {
+          "description": "Automation details that describe this run.",
+          "$ref": "#/$defs/runAutomationDetails"
+        },
+        "runAggregates": {
+          "description": "Automation details that describe the aggregate of runs to which this run belongs.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/runAutomationDetails"
+          }
+        },
+        "baselineGuid": {
+          "description": "The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run.",
+          "type": "string",
+          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
+        },
+        "redactionTokens": {
+          "description": "An array of strings used to replace sensitive information in a redaction-aware property.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "type": "string"
+          }
+        },
+        "defaultEncoding": {
+          "description": "Specifies the default encoding for any artifact object that refers to a text file.",
+          "type": "string"
+        },
+        "defaultSourceLanguage": {
+          "description": "Specifies the default source language for any artifact object that refers to a text file that contains source code.",
+          "type": "string"
+        },
+        "newlineSequences": {
+          "description": "An ordered list of character sequences that were treated as line breaks when computing region information for the run.",
+          "type": "array",
+          "minItems": 1,
+          "uniqueItems": true,
+          "default": [
+            "\r\n",
+            "\n"
+          ],
+          "items": {
+            "type": "string"
+          }
+        },
+        "columnKind": {
+          "description": "Specifies the unit in which the tool measures columns.",
+          "enum": [
+            "utf16CodeUnits",
+            "unicodeCodePoints"
+          ],
+          "type": "string"
+        },
+        "externalPropertyFileReferences": {
+          "description": "References to external property files that should be inlined with the content of a root log file.",
+          "$ref": "#/$defs/externalPropertyFileReferences"
+        },
+        "threadFlowLocations": {
+          "description": "An array of threadFlowLocation objects cached at run level.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/threadFlowLocation"
+          }
+        },
+        "taxonomies": {
+          "description": "An array of toolComponent objects relevant to a taxonomy in which results are categorized.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/toolComponent"
+          }
+        },
+        "addresses": {
+          "description": "Addresses associated with this run instance, if any.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/address"
+          }
+        },
+        "translations": {
+          "description": "The set of available translations of the localized data provided by the tool.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/toolComponent"
+          }
+        },
+        "policies": {
+          "description": "Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line).",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/toolComponent"
+          }
+        },
+        "webRequests": {
+          "description": "An array of request objects cached at run level.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/webRequest"
+          }
+        },
+        "webResponses": {
+          "description": "An array of response objects cached at run level.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/webResponse"
+          }
+        },
+        "specialLocations": {
+          "description": "A specialLocations object that defines locations of special significance to SARIF consumers.",
+          "$ref": "#/$defs/specialLocations"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the run.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "tool"
+      ]
+    },
+    "runAutomationDetails": {
+      "description": "Information that describes a run's identity and role within an engineering system process.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "description": {
+          "description": "A description of the identity and role played within the engineering system by this object's containing run object.",
+          "$ref": "#/$defs/message"
+        },
+        "id": {
+          "description": "A hierarchical string that uniquely identifies this object's containing run object.",
+          "type": "string"
+        },
+        "guid": {
+          "description": "A stable, unique identifier for this object's containing run object in the form of a GUID.",
+          "$ref": "#/$defs/guid"
+        },
+        "correlationGuid": {
+          "description": "A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID.",
+          "type": "string",
+          "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the run automation details.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "specialLocations": {
+      "description": "Defines locations of special significance to SARIF consumers.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "displayBase": {
+          "description": "Provides a suggestion to SARIF consumers to display file paths relative to the specified location.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the special locations.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "stack": {
+      "description": "A call stack that is relevant to a result.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "message": {
+          "description": "A message relevant to this call stack.",
+          "$ref": "#/$defs/message"
+        },
+        "frames": {
+          "description": "An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "items": {
+            "$ref": "#/$defs/stackFrame"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the stack.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "frames"
+      ]
+    },
+    "stackFrame": {
+      "description": "A function call within a stack trace.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "location": {
+          "description": "The location to which this stack frame refers.",
+          "$ref": "#/$defs/location"
+        },
+        "module": {
+          "description": "The name of the module that contains the code of this stack frame.",
+          "type": "string"
+        },
+        "threadId": {
+          "description": "The thread identifier of the stack frame.",
+          "type": "integer"
+        },
+        "parameters": {
+          "description": "The parameters of the call that is executing.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": false,
+          "default": [],
+          "items": {
+            "type": "string",
+            "default": []
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the stack frame.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "suppression": {
+      "description": "A suppression that is relevant to a result.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "guid": {
+          "description": "A stable, unique identifier for the suprression in the form of a GUID.",
+          "$ref": "#/$defs/guid"
+        },
+        "kind": {
+          "description": "A string that indicates where the suppression is persisted.",
+          "enum": [
+            "inSource",
+            "external"
+          ],
+          "type": "string"
+        },
+        "status": {
+          "description": "A string that indicates the review status of the suppression.",
+          "enum": [
+            "accepted",
+            "underReview",
+            "rejected"
+          ],
+          "type": "string"
+        },
+        "justification": {
+          "description": "A string representing the justification for the suppression.",
+          "type": "string"
+        },
+        "location": {
+          "description": "Identifies the location associated with the suppression.",
+          "$ref": "#/$defs/location"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the suppression.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "kind"
+      ]
+    },
+    "threadFlow": {
+      "description": "Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "id": {
+          "description": "An string that uniquely identifies the threadFlow within the codeFlow in which it occurs.",
+          "type": "string"
+        },
+        "message": {
+          "description": "A message relevant to the thread flow.",
+          "$ref": "#/$defs/message"
+        },
+        "initialState": {
+          "description": "Values of relevant expressions at the start of the thread flow that may change during thread flow execution.",
+          "type": "object",
+          "additionalProperties": {
+            "$ref": "#/$defs/multiformatMessageString"
+          }
+        },
+        "immutableState": {
+          "description": "Values of relevant expressions at the start of the thread flow that remain constant.",
+          "type": "object",
+          "additionalProperties": {
+            "$ref": "#/$defs/multiformatMessageString"
+          }
+        },
+        "locations": {
+          "description": "A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result.",
+          "type": "array",
+          "minItems": 1,
+          "uniqueItems": false,
+          "items": {
+            "$ref": "#/$defs/threadFlowLocation"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the thread flow.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "locations"
+      ]
+    },
+    "threadFlowLocation": {
+      "description": "A location visited by an analysis tool while simulating or monitoring the execution of a program.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "index": {
+          "description": "The index within the run threadFlowLocations array.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "location": {
+          "description": "The code location.",
+          "$ref": "#/$defs/location"
+        },
+        "stack": {
+          "description": "The call stack leading to this location.",
+          "$ref": "#/$defs/stack"
+        },
+        "kinds": {
+          "description": "A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "type": "string"
+          }
+        },
+        "taxa": {
+          "description": "An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location.",
+          "type": "array",
+          "default": [],
+          "minItems": 0,
+          "uniqueItems": true,
+          "items": {
+            "$ref": "#/$defs/reportingDescriptorReference"
+          }
+        },
+        "module": {
+          "description": "The name of the module that contains the code that is executing.",
+          "type": "string"
+        },
+        "state": {
+          "description": "A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables.",
+          "type": "object",
+          "additionalProperties": {
+            "$ref": "#/$defs/multiformatMessageString"
+          }
+        },
+        "nestingLevel": {
+          "description": "An integer representing a containment hierarchy within the thread flow.",
+          "type": "integer",
+          "minimum": 0
+        },
+        "executionOrder": {
+          "description": "An integer representing the temporal order in which execution reached this location.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "executionTimeUtc": {
+          "description": "The Coordinated Universal Time (UTC) date and time at which this location was executed.",
+          "type": "string",
+          "format": "date-time"
+        },
+        "importance": {
+          "description": "Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is \"essential\", \"important\", \"unimportant\". Default: \"important\".",
+          "enum": [
+            "important",
+            "essential",
+            "unimportant"
+          ],
+          "default": "important",
+          "type": "string"
+        },
+        "webRequest": {
+          "description": "A web request associated with this thread flow location.",
+          "$ref": "#/$defs/webRequest"
+        },
+        "webResponse": {
+          "description": "A web response associated with this thread flow location.",
+          "$ref": "#/$defs/webResponse"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the threadflow location.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "tool": {
+      "description": "The analysis tool that was run.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "driver": {
+          "description": "The analysis tool that was run.",
+          "$ref": "#/$defs/toolComponent"
+        },
+        "extensions": {
+          "description": "Tool extensions that contributed to or reconfigured the analysis tool that was run.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/toolComponent"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the tool.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "driver"
+      ]
+    },
+    "toolComponent": {
+      "description": "A component, such as a plug-in or the driver, of the analysis tool that was run.",
+      "additionalProperties": false,
+      "type": "object",
+      "properties": {
+        "guid": {
+          "description": "A unique identifier for the tool component in the form of a GUID.",
+          "$ref": "#/$defs/guid"
+        },
+        "name": {
+          "description": "The name of the tool component.",
+          "type": "string"
+        },
+        "organization": {
+          "description": "The organization or company that produced the tool component.",
+          "type": "string"
+        },
+        "product": {
+          "description": "A product suite to which the tool component belongs.",
+          "type": "string"
+        },
+        "productSuite": {
+          "description": "A localizable string containing the name of the suite of products to which the tool component belongs.",
+          "type": "string"
+        },
+        "shortDescription": {
+          "description": "A brief description of the tool component.",
+          "$ref": "#/$defs/multiformatMessageString"
+        },
+        "fullDescription": {
+          "description": "A comprehensive description of the tool component.",
+          "$ref": "#/$defs/multiformatMessageString"
+        },
+        "fullName": {
+          "description": "The name of the tool component along with its version and any other useful identifying information, such as its locale.",
+          "type": "string"
+        },
+        "version": {
+          "description": "The tool component version, in whatever format the component natively provides.",
+          "type": "string"
+        },
+        "semanticVersion": {
+          "description": "The tool component version in the format specified by Semantic Versioning 2.0.",
+          "type": "string"
+        },
+        "dottedQuadFileVersion": {
+          "description": "The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way).",
+          "type": "string",
+          "pattern": "[0-9]+(\\.[0-9]+){3}"
+        },
+        "releaseDateUtc": {
+          "description": "A string specifying the UTC date (and optionally, the time) of the component's release.",
+          "type": "string"
+        },
+        "downloadUri": {
+          "description": "The absolute URI from which the tool component can be downloaded.",
+          "type": "string",
+          "format": "uri"
+        },
+        "informationUri": {
+          "description": "The absolute URI at which information about this version of the tool component can be found.",
+          "type": "string",
+          "format": "uri"
+        },
+        "globalMessageStrings": {
+          "description": "A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.",
+          "type": "object",
+          "additionalProperties": {
+            "$ref": "#/$defs/multiformatMessageString"
+          }
+        },
+        "notifications": {
+          "description": "An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/reportingDescriptor"
+          }
+        },
+        "rules": {
+          "description": "An array of reportingDescriptor objects relevant to the analysis performed by the tool component.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/reportingDescriptor"
+          }
+        },
+        "taxa": {
+          "description": "An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/reportingDescriptor"
+          }
+        },
+        "locations": {
+          "description": "An array of the artifactLocation objects associated with the tool component.",
+          "type": "array",
+          "minItems": 0,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/artifactLocation"
+          }
+        },
+        "language": {
+          "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).",
+          "$ref": "#/$defs/language"
+        },
+        "contents": {
+          "description": "The kinds of data contained in this object.",
+          "type": "array",
+          "uniqueItems": true,
+          "default": [
+            "localizedData",
+            "nonLocalizedData"
+          ],
+          "items": {
+            "enum": [
+              "localizedData",
+              "nonLocalizedData"
+            ],
+            "type": "string"
+          }
+        },
+        "isComprehensive": {
+          "description": "Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file.",
+          "type": "boolean",
+          "default": false
+        },
+        "localizedDataSemanticVersion": {
+          "description": "The semantic version of the localized strings defined in this component; maintained by components that provide translations.",
+          "type": "string"
+        },
+        "minimumRequiredLocalizedDataSemanticVersion": {
+          "description": "The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations.",
+          "type": "string"
+        },
+        "associatedComponent": {
+          "description": "The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model.",
+          "$ref": "#/$defs/toolComponentReference"
+        },
+        "translationMetadata": {
+          "description": "Translation metadata, required for a translation, not populated by other component types.",
+          "$ref": "#/$defs/translationMetadata"
+        },
+        "supportedTaxonomies": {
+          "description": "An array of toolComponentReference objects to declare the taxonomies supported by the tool component.",
+          "type": "array",
+          "minItems": 0,
+          "uniqueItems": true,
+          "default": [],
+          "items": {
+            "$ref": "#/$defs/toolComponentReference"
+          }
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the tool component.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "name"
+      ]
+    },
+    "toolComponentReference": {
+      "description": "Identifies a particular toolComponent object, either the driver or an extension.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "name": {
+          "description": "The 'name' property of the referenced toolComponent.",
+          "type": "string"
+        },
+        "index": {
+          "description": "An index into the referenced toolComponent in tool.extensions.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "guid": {
+          "description": "The 'guid' property of the referenced toolComponent.",
+          "$ref": "#/$defs/guid"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the toolComponentReference.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "translationMetadata": {
+      "description": "Provides additional metadata related to translation.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "name": {
+          "description": "The name associated with the translation metadata.",
+          "type": "string"
+        },
+        "fullName": {
+          "description": "The full name associated with the translation metadata.",
+          "type": "string"
+        },
+        "shortDescription": {
+          "description": "A brief description of the translation metadata.",
+          "$ref": "#/$defs/multiformatMessageString"
+        },
+        "fullDescription": {
+          "description": "A comprehensive description of the translation metadata.",
+          "$ref": "#/$defs/multiformatMessageString"
+        },
+        "downloadUri": {
+          "description": "The absolute URI from which the translation metadata can be downloaded.",
+          "type": "string",
+          "format": "uri"
+        },
+        "informationUri": {
+          "description": "The absolute URI from which information related to the translation metadata can be downloaded.",
+          "type": "string",
+          "format": "uri"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the translation metadata.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "name"
+      ]
+    },
+    "versionControlDetails": {
+      "description": "Specifies the information necessary to retrieve a desired revision from a version control system.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "repositoryUri": {
+          "description": "The absolute URI of the repository.",
+          "type": "string",
+          "format": "uri"
+        },
+        "revisionId": {
+          "description": "A string that uniquely and permanently identifies the revision within the repository.",
+          "type": "string"
+        },
+        "branch": {
+          "description": "The name of a branch containing the revision.",
+          "type": "string"
+        },
+        "revisionTag": {
+          "description": "A tag that has been applied to the revision.",
+          "type": "string"
+        },
+        "asOfTimeUtc": {
+          "description": "A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time.",
+          "type": "string",
+          "format": "date-time"
+        },
+        "mappedTo": {
+          "description": "The location in the local file system to which the root of the repository was mapped at the time of the analysis.",
+          "$ref": "#/$defs/artifactLocation"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the version control details.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      },
+      "required": [
+        "repositoryUri"
+      ]
+    },
+    "webRequest": {
+      "description": "Describes an HTTP request.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "index": {
+          "description": "The index within the run.webRequests array of the request object associated with this result.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "protocol": {
+          "description": "The request protocol. Example: 'http'.",
+          "type": "string"
+        },
+        "version": {
+          "description": "The request version. Example: '1.1'.",
+          "type": "string"
+        },
+        "target": {
+          "description": "The target of the request.",
+          "type": "string"
+        },
+        "method": {
+          "description": "The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.",
+          "type": "string"
+        },
+        "headers": {
+          "description": "The request headers.",
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        },
+        "parameters": {
+          "description": "The request parameters.",
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        },
+        "body": {
+          "description": "The body of the request.",
+          "$ref": "#/$defs/artifactContent"
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the request.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    },
+    "webResponse": {
+      "description": "Describes the response to an HTTP request.",
+      "type": "object",
+      "additionalProperties": false,
+      "properties": {
+        "index": {
+          "description": "The index within the run.webResponses array of the response object associated with this result.",
+          "type": "integer",
+          "default": -1,
+          "minimum": -1
+        },
+        "protocol": {
+          "description": "The response protocol. Example: 'http'.",
+          "type": "string"
+        },
+        "version": {
+          "description": "The response version. Example: '1.1'.",
+          "type": "string"
+        },
+        "statusCode": {
+          "description": "The response status code. Example: 451.",
+          "type": "integer"
+        },
+        "reasonPhrase": {
+          "description": "The response reason. Example: 'Not found'.",
+          "type": "string"
+        },
+        "headers": {
+          "description": "The response headers.",
+          "type": "object",
+          "additionalProperties": {
+            "type": "string"
+          }
+        },
+        "body": {
+          "description": "The body of the response.",
+          "$ref": "#/$defs/artifactContent"
+        },
+        "noResponseReceived": {
+          "description": "Specifies whether a response was received from the server.",
+          "type": "boolean",
+          "default": false
+        },
+        "properties": {
+          "description": "Key/value pairs that provide additional information about the response.",
+          "$ref": "#/$defs/propertyBag"
+        }
+      }
+    }
+  }
+}
diff --git a/gcc/testsuite/lib/scansarif.exp b/gcc/testsuite/lib/scansarif.exp
index ea6a88340b5e..f27f3ee2164b 100644
--- a/gcc/testsuite/lib/scansarif.exp
+++ b/gcc/testsuite/lib/scansarif.exp
@@ -59,6 +59,10 @@  proc scan-sarif-file-not { args } {
 #
 # Assuming "check-jsonschema" is available, use it to verify that the .sarif
 # file complies with the SARIF schema.
+#
+# The first argument is the version of the SARIF schema to validate against
+# If present can be "2.1" or "2.2"
+# If absent, validate against 2.1
 
 proc verify-sarif-file { args } {
     global srcdir subdir
@@ -67,6 +71,9 @@  proc verify-sarif-file { args } {
     set filename [lindex $testcase 0]
     set output_file "[file tail $filename].sarif"
 
+    set version [lindex $args 0]
+    verbose "sarif version: $version" 2
+
     if { ![check_effective_target_recent_python3] } {
 	unsupported "$testcase verify-sarif-file: python3 is missing"
 	return
@@ -91,10 +98,22 @@  proc verify-sarif-file { args } {
 	return	
     }
 
-    set schema_file $srcdir/lib/sarif-schema-2.1.0.json
+    # Handle different versions of SARIF
+    if { $version == "" } {
+	set version "2.1"
+    }
+    
+    if { $version == "2.1" } {
+	set schema_file $srcdir/lib/sarif-schema-2.1.0.json
+    } elseif { $version == "2.2" } {
+	set schema_file $srcdir/lib/sarif-schema-2.2-prerelease-2024-08-08.json
+    } else {
+	fail "unrecognized sarif version: $version"
+	return
+    }
     verbose "schema_file: $schema_file" 2
 
-    set what "$testcase (test .sarif output against SARIF schema)"
+    set what "$testcase (test .sarif output against SARIF $version schema)"
     if [catch {exec check-jsonschema --schemafile $schema_file $output_file} res ] {
 	verbose "verify-sarif-file: res: $res" 2
 	fail "$what"