Add examples demonstrating cached objects and index property #382
Labels
2.1.0-CSD.1
Will be fixed in SARIF v2.1.0 CSD.1.
impact-documentation-only
merged
Changes merged into provisional draft.
non-substantive
Change falls under editorial discretion
resolved-fixed
This is what I wrote in an email to Ykaterina. She suggested I include it in the spec:
EXAMPLE 1: In this example,
thisObject
is an element oftheRun.requests
. We know what array index it’s at (0) sothisObject.index
isn’t required: it MAY be present. But if it’s present, it had better equal that array index.EXAMPLE 2: In this example,
thisObject
is not an element oftheRun.Request
. Rather, it’s the value oftheResult.request
. And in this example, there is no “cached” object. That is, there is no object intheRun.requests
that provides additional information forthisObject
. In fact, in this example,theRun.requests
doesn’t exist at all. All the information is inline intheResult.request
. Since there is no cached object forthisObject
,thisObject.index
SHALL NOT be present.EXAMPLE 3: Finally, in this example,
thisObject
is again the value oftheResult.request
, not an element oftheRun.requests
. But in this case, there is a cached object, an element oftheRun.requests
that provides additional information forthisObject
.thisObject
provides only thetarget
property. Since we need to populate the remaining properties ofthisObject
from the cached object,thisObject.index
SHALL be present.The text was updated successfully, but these errors were encountered: