Fix schemas and add $id properties for oneof[] fields
oneof[] properties are an array of referenced json schemas. In cases
where we need to look through generated logs based on these schemas, it
is much easier to use a hook based on the $id property that uniquely
identifies a nested child property. The $id property allows us to
uniquely identify each data type based on the cper specification.
Fix schemas: Sections and ErrorInformation need a "properties" field
under each oneOf[]. Also add a "type" for cacheError and tlbError to
conform with json schema.
Tested with libcper json validator.
Change-Id: I2b242e93e1667a7d7b7a3a77eba1d37347920d1a
Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>
diff --git a/specification/json/sections/cper-arm-processor.json b/specification/json/sections/cper-arm-processor.json
index c1e7500..6efb2ae 100644
--- a/specification/json/sections/cper-arm-processor.json
+++ b/specification/json/sections/cper-arm-processor.json
@@ -1,5 +1,4 @@
{
- "$id": "cper-json-arm-processor-section",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
@@ -166,198 +165,206 @@
"type": "object",
"oneOf": [
{
+ "$id": "cper-json-cacheerror-section",
+ "type": "object",
"required": ["cacheError"],
- "cacheError": {
- "type": "object",
- "required": [
- "validationBits",
- "transactionType",
- "operation",
- "level",
- "processorContextCorrupt",
- "corrected",
- "precisePC",
- "restartablePC"
- ],
- "additionalProperties": false,
- "properties": {
- "validationBits": {
- "type": "object",
- "required": [
- "transactionTypeValid",
- "operationValid",
- "levelValid",
- "processorContextCorruptValid",
- "correctedValid",
- "precisePCValid",
- "restartablePCValid"
- ],
- "properties": {
- "transactionTypeValid": {
- "type": "boolean"
- },
- "operationValid": {
- "type": "boolean"
- },
- "levelValid": {
- "type": "boolean"
- },
- "processorContextCorruptValid": {
- "type": "boolean"
- },
- "correctedValid": {
- "type": "boolean"
- },
- "precisePCValid": {
- "type": "boolean"
- },
- "restartablePCValid": {
- "type": "boolean"
+ "properties": {
+ "cacheError": {
+ "type": "object",
+ "required": [
+ "validationBits",
+ "transactionType",
+ "operation",
+ "level",
+ "processorContextCorrupt",
+ "corrected",
+ "precisePC",
+ "restartablePC"
+ ],
+ "additionalProperties": false,
+ "properties": {
+ "validationBits": {
+ "type": "object",
+ "required": [
+ "transactionTypeValid",
+ "operationValid",
+ "levelValid",
+ "processorContextCorruptValid",
+ "correctedValid",
+ "precisePCValid",
+ "restartablePCValid"
+ ],
+ "properties": {
+ "transactionTypeValid": {
+ "type": "boolean"
+ },
+ "operationValid": {
+ "type": "boolean"
+ },
+ "levelValid": {
+ "type": "boolean"
+ },
+ "processorContextCorruptValid": {
+ "type": "boolean"
+ },
+ "correctedValid": {
+ "type": "boolean"
+ },
+ "precisePCValid": {
+ "type": "boolean"
+ },
+ "restartablePCValid": {
+ "type": "boolean"
+ }
}
+ },
+ "transactionType": {
+ "type": "object",
+ "$ref": "./common/cper-json-nvp.json"
+ },
+ "operation": {
+ "type": "object",
+ "$ref": "./common/cper-json-nvp.json"
+ },
+ "level": {
+ "type": "integer"
+ },
+ "processorContextCorrupt": {
+ "type": "boolean"
+ },
+ "corrected": {
+ "type": "boolean"
+ },
+ "precisePC": {
+ "type": "boolean"
+ },
+ "restartablePC": {
+ "type": "boolean"
}
- },
- "transactionType": {
- "type": "object",
- "$ref": "./common/cper-json-nvp.json"
- },
- "operation": {
- "type": "object",
- "$ref": "./common/cper-json-nvp.json"
- },
- "level": {
- "type": "integer"
- },
- "processorContextCorrupt": {
- "type": "boolean"
- },
- "corrected": {
- "type": "boolean"
- },
- "precisePC": {
- "type": "boolean"
- },
- "restartablePC": {
- "type": "boolean"
}
}
}
},
{
+ "$id": "cper-json-tlberror-section",
+ "type": "object",
"required": ["tlbError"],
- "tlbError": {
- "type": "object",
- "required": [
- "validationBits",
- "transactionType",
- "operation",
- "level",
- "processorContextCorrupt",
- "corrected",
- "precisePC",
- "restartablePC",
- "timedOut",
- "participationType",
- "addressSpace",
- "memoryAttributes",
- "accessMode"
- ],
- "additionalProperties": false,
- "properties": {
- "validationBits": {
- "type": "object",
- "required": [
- "transactionTypeValid",
- "operationValid",
- "levelValid",
- "processorContextCorruptValid",
- "correctedValid",
- "precisePCValid",
- "restartablePCValid",
- "participationTypeValid",
- "timedOutValid",
- "addressSpaceValid",
- "memoryAttributesValid",
- "accessModeValid"
- ],
- "properties": {
- "transactionTypeValid": {
- "type": "boolean"
- },
- "operationValid": {
- "type": "boolean"
- },
- "levelValid": {
- "type": "boolean"
- },
- "processorContextCorruptValid": {
- "type": "boolean"
- },
- "correctedValid": {
- "type": "boolean"
- },
- "precisePCValid": {
- "type": "boolean"
- },
- "restartablePCValid": {
- "type": "boolean"
- },
- "participationTypeValid": {
- "type": "boolean"
- },
- "timedOutValid": {
- "type": "boolean"
- },
- "addressSpaceValid": {
- "type": "boolean"
- },
- "memoryAttributesValid": {
- "type": "boolean"
- },
- "accessModeValid": {
- "type": "boolean"
+ "properties": {
+ "tlbError": {
+ "type": "object",
+ "required": [
+ "validationBits",
+ "transactionType",
+ "operation",
+ "level",
+ "processorContextCorrupt",
+ "corrected",
+ "precisePC",
+ "restartablePC",
+ "timedOut",
+ "participationType",
+ "addressSpace",
+ "memoryAttributes",
+ "accessMode"
+ ],
+ "additionalProperties": false,
+ "properties": {
+ "validationBits": {
+ "type": "object",
+ "required": [
+ "transactionTypeValid",
+ "operationValid",
+ "levelValid",
+ "processorContextCorruptValid",
+ "correctedValid",
+ "precisePCValid",
+ "restartablePCValid",
+ "participationTypeValid",
+ "timedOutValid",
+ "addressSpaceValid",
+ "memoryAttributesValid",
+ "accessModeValid"
+ ],
+ "properties": {
+ "transactionTypeValid": {
+ "type": "boolean"
+ },
+ "operationValid": {
+ "type": "boolean"
+ },
+ "levelValid": {
+ "type": "boolean"
+ },
+ "processorContextCorruptValid": {
+ "type": "boolean"
+ },
+ "correctedValid": {
+ "type": "boolean"
+ },
+ "precisePCValid": {
+ "type": "boolean"
+ },
+ "restartablePCValid": {
+ "type": "boolean"
+ },
+ "participationTypeValid": {
+ "type": "boolean"
+ },
+ "timedOutValid": {
+ "type": "boolean"
+ },
+ "addressSpaceValid": {
+ "type": "boolean"
+ },
+ "memoryAttributesValid": {
+ "type": "boolean"
+ },
+ "accessModeValid": {
+ "type": "boolean"
+ }
}
+ },
+ "transactionType": {
+ "type": "object",
+ "$ref": "./common/cper-json-nvp.json"
+ },
+ "operation": {
+ "type": "object",
+ "$ref": "./common/cper-json-nvp.json"
+ },
+ "level": {
+ "type": "integer"
+ },
+ "processorContextCorrupt": {
+ "type": "boolean"
+ },
+ "corrected": {
+ "type": "boolean"
+ },
+ "precisePC": {
+ "type": "boolean"
+ },
+ "restartablePC": {
+ "type": "boolean"
+ },
+ "timedOut": {
+ "type": "boolean"
+ },
+ "participationType": {
+ "type": "object",
+ "$ref": "./common/cper-json-nvp.json"
+ },
+ "addressSpace": {
+ "type": "object",
+ "$ref": "./common/cper-json-nvp.json"
+ },
+ "accessMode": {
+ "type": "object",
+ "$ref": "./common/cper-json-nvp.json"
+ },
+ "memoryAttributes": {
+ "type": "integer"
}
- },
- "transactionType": {
- "type": "object",
- "$ref": "./common/cper-json-nvp.json"
- },
- "operation": {
- "type": "object",
- "$ref": "./common/cper-json-nvp.json"
- },
- "level": {
- "type": "integer"
- },
- "processorContextCorrupt": {
- "type": "boolean"
- },
- "corrected": {
- "type": "boolean"
- },
- "precisePC": {
- "type": "boolean"
- },
- "restartablePC": {
- "type": "boolean"
- },
- "timedOut": {
- "type": "boolean"
- },
- "participationType": {
- "type": "object",
- "$ref": "./common/cper-json-nvp.json"
- },
- "addressSpace": {
- "type": "object",
- "$ref": "./common/cper-json-nvp.json"
- },
- "accessMode": {
- "type": "object",
- "$ref": "./common/cper-json-nvp.json"
- },
- "memoryAttributes": {
- "type": "integer"
}
}
}
@@ -400,6 +407,7 @@
"type": "object",
"oneOf": [
{
+ "$id": "cper-json-registerarray0",
"type": "object",
"required": [
"r1",
@@ -438,6 +446,7 @@
}
},
{
+ "$id": "cper-json-registerarray1",
"type": "object",
"required": [
"dfar",
@@ -493,6 +502,7 @@
}
},
{
+ "$id": "cper-json-registerarray2",
"type": "object",
"required": [
"elr_hyp",
@@ -532,6 +542,7 @@
}
},
{
+ "$id": "cper-json-registerarray3",
"type": "object",
"required": ["sctlr_s", "spsr_mon"],
"properties": {
@@ -540,6 +551,7 @@
}
},
{
+ "$id": "cper-json-registerarray4",
"type": "object",
"required": [
"x0",
@@ -611,6 +623,7 @@
}
},
{
+ "$id": "cper-json-registerarray5",
"type": "object",
"required": [
"elr_el1",
@@ -652,6 +665,7 @@
}
},
{
+ "$id": "cper-json-registerarray6",
"type": "object",
"required": [
"elr_el2",
@@ -689,6 +703,7 @@
}
},
{
+ "$id": "cper-json-registerarray7",
"type": "object",
"required": [
"elr_el3",
@@ -716,6 +731,7 @@
}
},
{
+ "$id": "cper-json-registerarray8",
"type": "object",
"required": ["mrsEncoding", "value"],
"additionalProperties": false,
@@ -743,6 +759,7 @@
}
},
{
+ "$id": "cper-json-registerarray9",
"type": "object",
"required": ["data"],
"properties": {