github-sarif-validator-jest
Version:
A Jest package that allows you to validate a Sarif output is compatible for Github Code scanning
1,490 lines (1,487 loc) • 109 kB
JavaScript
var __defProp = Object.defineProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
// schemas/github-sarif-schema.json
var github_sarif_schema_exports = {};
__export(github_sarif_schema_exports, {
$id: () => $id,
$schema: () => $schema,
allOf: () => allOf,
default: () => github_sarif_schema_default,
description: () => description,
properties: () => properties,
title: () => title,
type: () => type
});
var $id = "github-sarif-schema";
var title = "SARIF GitHub Extended Schema";
var description = "An extension of the SARIF 2.1.0 schema to add GitHub-specific requirements.";
var $schema = "http://json-schema.org/draft-07/schema#";
var allOf = [
{
$ref: "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json"
}
];
var type = "object";
var properties = {
runs: {
type: "array",
items: {
type: "object",
properties: {
results: {
type: "array",
items: {
type: "object",
properties: {
ruleId: {
type: "string",
description: "Unique identifier for the rule."
},
message: {
type: "object",
properties: {
text: {
type: "string",
description: "Message text for the result."
}
},
required: ["text"]
},
locations: {
type: "array",
items: {
type: "object",
properties: {
physicalLocation: {
type: "object",
properties: {
artifactLocation: {
type: "object",
properties: {
uri: {
type: "string",
description: "Location in the source code where the issue was detected."
}
},
required: ["uri"]
}
},
required: ["artifactLocation"]
}
},
required: ["physicalLocation"]
}
},
partialFingerprints: {
type: "object",
minProperties: 1,
description: "A unique identifier for the result"
},
rule: {
type: "object",
properties: {
index: {
type: "integer",
description: "The index within the tool component rules array of the rule object associated with this result."
}
},
required: ["index"]
}
},
required: ["ruleId", "message", "locations"]
}
},
tool: {
type: "object",
properties: {
driver: {
type: "object",
properties: {
rules: {
type: "array",
items: {
type: "object",
properties: {
id: {
type: "string",
description: "Unique identifier for the rule."
},
shortDescription: {
type: "object",
properties: {
text: {
type: "string",
description: "A short summary of the rule."
}
},
required: ["text"]
},
fullDescription: {
type: "object",
properties: {
text: {
type: "string",
description: "A detailed description of the rule."
}
},
required: ["text"]
},
helpUri: {
type: "string",
description: "A link to more detailed documentation for the rule."
},
help: {
type: "object",
properties: {
text: {
type: "string",
description: "A markdown description that provides more detailed guidance on the rule."
}
},
required: ["text"]
}
},
required: [
"id",
"shortDescription",
"fullDescription",
"helpUri",
"help"
]
}
}
}
}
}
}
}
}
}
};
var github_sarif_schema_default = {
$id,
title,
description,
$schema,
allOf,
type,
properties
};
// src/valid-github-sarif-log.ts
import addFormats from "ajv-formats";
// schemas/sarif-schema-2.1.0.json
var sarif_schema_2_1_0_exports = {};
__export(sarif_schema_2_1_0_exports, {
$id: () => $id2,
$schema: () => $schema2,
additionalProperties: () => additionalProperties,
default: () => sarif_schema_2_1_0_default,
definitions: () => definitions,
description: () => description2,
properties: () => properties2,
required: () => required,
title: () => title2,
type: () => type2
});
var $schema2 = "http://json-schema.org/draft-07/schema#";
var title2 = "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema";
var $id2 = "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json";
var description2 = "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools.";
var additionalProperties = false;
var type2 = "object";
var properties2 = {
$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.1.0"],
type: "string"
},
runs: {
description: "The set of runs contained in this log file.",
type: ["array", "null"],
minItems: 0,
uniqueItems: false,
items: {
$ref: "#/definitions/run"
}
},
inlineExternalProperties: {
description: "References to external property files that share data between runs.",
type: "array",
minItems: 0,
uniqueItems: true,
items: {
$ref: "#/definitions/externalProperties"
}
},
properties: {
description: "Key/value pairs that provide additional information about the log file.",
$ref: "#/definitions/propertyBag"
}
};
var required = ["version", "runs"];
var definitions = {
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: "#/definitions/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: "#/definitions/message"
},
location: {
description: "The location of the artifact.",
$ref: "#/definitions/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",
"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: "#/definitions/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: "#/definitions/propertyBag"
}
}
},
artifactChange: {
description: "A change to a single artifact.",
additionalProperties: false,
type: "object",
properties: {
artifactLocation: {
description: "The location of the artifact to change.",
$ref: "#/definitions/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: "#/definitions/replacement"
}
},
properties: {
description: "Key/value pairs that provide additional information about the change.",
$ref: "#/definitions/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: "#/definitions/multiformatMessageString"
},
properties: {
description: "Key/value pairs that provide additional information about the artifact content.",
$ref: "#/definitions/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: "#/definitions/message"
},
properties: {
description: "Key/value pairs that provide additional information about the artifact location.",
$ref: "#/definitions/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: "#/definitions/message"
},
artifactLocation: {
description: "The location of the attachment.",
$ref: "#/definitions/artifactLocation"
},
regions: {
description: "An array of regions of interest within the attachment.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/region"
}
},
rectangles: {
description: "An array of rectangles specifying areas of interest within the image.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/rectangle"
}
},
properties: {
description: "Key/value pairs that provide additional information about the attachment.",
$ref: "#/definitions/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: "#/definitions/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: "#/definitions/threadFlow"
}
},
properties: {
description: "Key/value pairs that provide additional information about the code flow.",
$ref: "#/definitions/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: "#/definitions/reportingConfiguration"
},
descriptor: {
description: "A reference used to locate the descriptor whose configuration was overridden.",
$ref: "#/definitions/reportingDescriptorReference"
},
properties: {
description: "Key/value pairs that provide additional information about the configuration override.",
$ref: "#/definitions/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: "#/definitions/tool"
},
invocation: {
description: "An invocation object that describes the invocation of the converter.",
$ref: "#/definitions/invocation"
},
analysisToolLogFiles: {
description: "The locations of the analysis tool's per-run log files.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/artifactLocation"
}
},
properties: {
description: "Key/value pairs that provide additional information about the conversion.",
$ref: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/message"
},
finalState: {
description: "The values of relevant expressions after the edge has been traversed.",
type: "object",
additionalProperties: {
$ref: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/exception"
}
},
properties: {
description: "Key/value pairs that provide additional information about the exception.",
$ref: "#/definitions/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.",
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}$"
},
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: "#/definitions/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: "#/definitions/graph"
}
},
externalizedProperties: {
description: "Key/value pairs that provide additional information that will be merged with a separate run.",
$ref: "#/definitions/propertyBag"
},
artifacts: {
description: "An array of artifact objects that will be merged with a separate run.",
type: "array",
minItems: 0,
uniqueItems: true,
items: {
$ref: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/result"
}
},
taxonomies: {
description: "Tool taxonomies that will be merged with a separate run.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/toolComponent"
}
},
driver: {
description: "The analysis tool object that will be merged with a separate run.",
$ref: "#/definitions/toolComponent"
},
extensions: {
description: "Tool extensions that will be merged with a separate run.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/toolComponent"
}
},
policies: {
description: "Tool policies that will be merged with a separate run.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/toolComponent"
}
},
translations: {
description: "Tool translations that will be merged with a separate run.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/toolComponent"
}
},
addresses: {
description: "Addresses that will be merged with a separate run.",
type: "array",
minItems: 0,
uniqueItems: false,
default: [],
items: {
$ref: "#/definitions/address"
}
},
webRequests: {
description: "Requests that will be merged with a separate run.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/webRequest"
}
},
webResponses: {
description: "Responses that will be merged with a separate run.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/webResponse"
}
},
properties: {
description: "Key/value pairs that provide additional information about the external properties.",
$ref: "#/definitions/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: "#/definitions/artifactLocation"
},
guid: {
description: "A stable, unique identifier for the external property file 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}$"
},
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: "#/definitions/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: "#/definitions/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: "#/definitions/externalPropertyFileReference"
}
},
externalizedProperties: {
description: "An external property file containing a run.properties object to be merged with the root log file.",
$ref: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/externalPropertyFileReference"
}
},
driver: {
description: "An external property file containing a run.driver object to be merged with the root log file.",
$ref: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/externalPropertyFileReference"
}
},
properties: {
description: "Key/value pairs that provide additional information about the external property files.",
$ref: "#/definitions/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: "#/definitions/message"
},
artifactChanges: {
description: "One or more artifact changes that comprise a fix for a result.",
type: "array",
minItems: 1,
uniqueItems: true,
items: {
$ref: "#/definitions/artifactChange"
}
},
properties: {
description: "Key/value pairs that provide additional information about the fix.",
$ref: "#/definitions/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: "#/definitions/message"
},
nodes: {
description: "An array of node objects representing the nodes of the graph.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/node"
}
},
edges: {
description: "An array of edge objects representing the edges of the graph.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/edge"
}
},
properties: {
description: "Key/value pairs that provide additional information about the graph.",
$ref: "#/definitions/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: "#/definitions/message"
},
initialState: {
description: "Values of relevant expressions at the start of the graph traversal that may change during graph traversal.",
type: "object",
additionalProperties: {
$ref: "#/definitions/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: "#/definitions/multiformatMessageString"
}
},
edgeTraversals: {
description: "The sequences of edges traversed by this graph traversal.",
type: "array",
minItems: 0,
uniqueItems: false,
default: [],
items: {
$ref: "#/definitions/edgeTraversal"
}
},
properties: {
description: "Key/value pairs that provide additional information about the graph traversal.",
$ref: "#/definitions/propertyBag"
}
},
oneOf: [
{
required: ["runGraphIndex"]
},
{
required: ["resultGraphIndex"]
}
]
},
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: "#/definitions/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: "#/definitions/configurationOverride"
}
},
notificationConfigurationOverrides: {
description: "An array of configurationOverride objects that describe notifications related runtime overrides.",
type: "array",
minItems: 0,
default: [],
uniqueItems: true,
items: {
$ref: "#/definitions/configurationOverride"
}
},
toolExecutionNotifications: {
description: "A list of runtime conditions detected by the tool during the analysis.",
type: "array",
minItems: 0,
uniqueItems: false,
default: [],
items: {
$ref: "#/definitions/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: "#/definitions/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: "#/definitions/artifactLocation"
},
workingDirectory: {
description: "The working directory for the invocation.",
$ref: "#/definitions/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: "#/definitions/artifactLocation"
},
stdout: {
description: "A file containing the standard output stream from the process that was invoked.",
$ref: "#/definitions/artifactLocation"
},
stderr: {
description: "A file containing the standard error stream from the process that was invoked.",
$ref: "#/definitions/artifactLocation"
},
stdoutStderr: {
description: "A file containing the interleaved standard output and standard error stream from the process that was invoked.",
$ref: "#/definitions/artifactLocation"
},
properties: {
description: "Key/value pairs that provide additional information about the invocation.",
$ref: "#/definitions/propertyBag"
}
},
required: ["executionSuccessful"]
},
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: "#/definitions/physicalLocation"
},
logicalLocations: {
description: "The logical locations associated with the result.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/logicalLocation"
}
},
message: {
description: "A message relevant to the location.",
$ref: "#/definitions/message"
},
annotations: {
description: "A set of regions relevant to the location.",
type: "array",
minItems: 0,
uniqueItems: true,
default: [],
items: {
$ref: "#/definitions/region"
}
},
relationships: {
description: "An array of objects that describe relationships between this location and others.",
type: "array",
default: [],
minItems: 0,
uniqueItems: true,
items: {
$ref: "#/definitions/locationRelationship"
}
},
properties: {
description: "Key/value pairs that provide additional information about the location.",
$ref: "#/definitions/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: "#/definitions/message"
},
properties: {
description: "Key/value pairs that provide additional information about the location relationship.",
$ref: "#/definitions/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: "#/definitions/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: "#/definitions/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: "#/definitions/propertyBag"
}
},
required: ["text"]
},
node: {
description: "Represents a node in a graph.",
type: "object",
additionalProperties: