You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unexpected token encountered when reading value for 'anyOf'. Expected StartObject, got StartArray. Path 'definitions.region.properties.anyOf', line 1783, position 18.
Or (using a different tool):
#/definitions/region/properties/anyOf: expected type is one of Boolean or JsonObject, found: JsonArray
Cause
The problem is not the ingredients of the anyOf we use here, those are OK but the embedding into the region object.
Unfortunately the schema implementation of the added anyOf constraint in the ERRATA01 is invalid as the confusingly named properties key of our domain specific language may have led us to believe we should inject the anyOf directly following that object.
"region": {
"description": "A region within an artifact where a result was detected.",
"additionalProperties": false,
"type": "object",
"properties": {
"snip": "some ... - - - 8< - - -",
"properties": {
"description": "Key/value pairs that provide additional information about the region.",
"$ref": "#/definitions/propertyBag"
},
"anyOf": [
{ "required": [ "startLine" ] },
{ "required": [ "charOffset" ] },
{ "required": [ "byteOffset" ] }
]
}
},
Cure
Instead we should inject it following the outer propertiesobject (that is a JSON Schema key adhering object). Like so:
"region": {
"description": "A region within an artifact where a result was detected.",
"additionalProperties": false,
"type": "object",
"properties": {
"snip": "some ... - - - 8< - - -",
"properties": {
"description": "Key/value pairs that provide additional information about the region.",
"$ref": "#/definitions/propertyBag"
}
},
"anyOf": [
{ "required": [ "startLine" ] },
{ "required": [ "charOffset" ] },
{ "required": [ "byteOffset" ] }
]
},
Symptoms
Current schema raises errors like:
Or (using a different tool):
Cause
The problem is not the ingredients of the
anyOf
we use here, those are OK but the embedding into the region object.Unfortunately the schema implementation of the added
anyOf
constraint in the ERRATA01 is invalid as the confusingly namedproperties
key of our domain specific language may have led us to believe we should inject theanyOf
directly following that object.Cure
Instead we should inject it following the outer
properties
object (that is a JSON Schema key adhering object). Like so:Then validation succeeds.
Diff
The diff (against the failing complete JSON file in the distributed errata package at https://www.oasis-open.org/committees/document.php?document_id=71047&wg_abbrev=sarif) is:
The tricky thing (in 2023) is, to debug draft4 JSON Schema issues as not all "alive" validators support such archaic versions.
The text was updated successfully, but these errors were encountered: