Fix required properties in schemas

With invalid properties not showing up in the output, they are not
required in the schema anymore.

Note: UTs test with all properties enabled in the cper-generator.

Tested by running example cpers against schemas

Change-Id: I54dcda2ae00587e4a7d59e0365eb41ac1669ba46
Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>
diff --git a/meson.build b/meson.build
index 9026168..fa054c5 100644
--- a/meson.build
+++ b/meson.build
@@ -18,11 +18,8 @@
     language: ['c', 'cpp'],
 )
 
-add_project_arguments(
-    '-DLIBCPER_EXAMPLES="'
-    + meson.current_source_dir() + '/examples"',
-    language: ['c', 'cpp'],
-)
+add_project_arguments('-DLIBCPER_EXAMPLES="'
+    + meson.current_source_dir() + '/examples"', language: ['c', 'cpp'])
 
 library_is_share = get_option('default_library') == 'shared'
 add_project_arguments('-D_POSIX_C_SOURCE=200809L', language: 'c')
diff --git a/specification/json/sections/cper-ccix-per.json b/specification/json/sections/cper-ccix-per.json
index f39678a..e708b4b 100644
--- a/specification/json/sections/cper-ccix-per.json
+++ b/specification/json/sections/cper-ccix-per.json
@@ -1,7 +1,7 @@
 {
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "type": "object",
-    "required": ["length", "ccixSourceID", "ccixPortID", "ccixPERLog"],
+    "required": ["length"],
     "additionalProperties": false,
     "properties": {
         "length": {
diff --git a/specification/json/sections/cper-cxl-component.json b/specification/json/sections/cper-cxl-component.json
index 9d3e8d4..fbefeef 100644
--- a/specification/json/sections/cper-cxl-component.json
+++ b/specification/json/sections/cper-cxl-component.json
@@ -2,7 +2,7 @@
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "type": "object",
     "description": "CXL Component Events Section",
-    "required": ["length", "deviceID", "deviceSerial"],
+    "required": ["length"],
     "additionalProperties": false,
     "properties": {
         "length": {
diff --git a/specification/json/sections/cper-cxl-protocol.json b/specification/json/sections/cper-cxl-protocol.json
index a0cf8a0..edc1328 100644
--- a/specification/json/sections/cper-cxl-protocol.json
+++ b/specification/json/sections/cper-cxl-protocol.json
@@ -2,15 +2,7 @@
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "type": "object",
     "description": "Compute Express Link (CXL) Protocol Error Section",
-    "required": [
-        "agentType",
-        "cxlAgentAddress",
-        "deviceID",
-        "dvsecLength",
-        "errorLogLength",
-        "cxlDVSEC",
-        "cxlErrorLog"
-    ],
+    "required": [],
     "additionalProperties": false,
     "properties": {
         "agentType": {
diff --git a/specification/json/sections/cper-generic-processor.json b/specification/json/sections/cper-generic-processor.json
index 6c6e0c2..bc29a95 100644
--- a/specification/json/sections/cper-generic-processor.json
+++ b/specification/json/sections/cper-generic-processor.json
@@ -2,21 +2,7 @@
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "type": "object",
     "description": "Generic Processor Error Section",
-    "required": [
-        "processorType",
-        "processorISA",
-        "errorType",
-        "operation",
-        "flags",
-        "level",
-        "cpuVersionInfo",
-        "cpuBrandString",
-        "processorID",
-        "targetAddress",
-        "requestorID",
-        "responderID",
-        "instructionIP"
-    ],
+    "required": [],
     "additionalProperties": false,
     "properties": {
         "processorType": {
diff --git a/specification/json/sections/cper-memory.json b/specification/json/sections/cper-memory.json
index 52e1fe9..b57beee 100644
--- a/specification/json/sections/cper-memory.json
+++ b/specification/json/sections/cper-memory.json
@@ -1,28 +1,7 @@
 {
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "type": "object",
-    "required": [
-        "errorStatus",
-        "bank",
-        "memoryErrorType",
-        "extended",
-        "physicalAddress",
-        "physicalAddressHex",
-        "physicalAddressMask",
-        "node",
-        "card",
-        "moduleRank",
-        "device",
-        "row",
-        "column",
-        "bitPosition",
-        "requestorID",
-        "responderID",
-        "targetID",
-        "rankNumber",
-        "cardSmbiosHandle",
-        "moduleSmbiosHandle"
-    ],
+    "required": [],
     "additionalProperties": false,
     "properties": {
         "errorStatus": {
diff --git a/specification/json/sections/cper-memory2.json b/specification/json/sections/cper-memory2.json
index 955a969..e5fbc38 100644
--- a/specification/json/sections/cper-memory2.json
+++ b/specification/json/sections/cper-memory2.json
@@ -1,29 +1,7 @@
 {
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "type": "object",
-    "required": [
-        "errorStatus",
-        "bank",
-        "memoryErrorType",
-        "status",
-        "physicalAddress",
-        "physicalAddressHex",
-        "physicalAddressMask",
-        "node",
-        "card",
-        "module",
-        "device",
-        "row",
-        "column",
-        "bitPosition",
-        "rank",
-        "chipID",
-        "requestorID",
-        "responderID",
-        "targetID",
-        "cardSmbiosHandle",
-        "moduleSmbiosHandle"
-    ],
+    "required": [],
     "additionalProperties": false,
     "properties": {
         "errorStatus": {
diff --git a/specification/json/sections/cper-pci-bus.json b/specification/json/sections/cper-pci-bus.json
index bffc494..9e6a26f 100644
--- a/specification/json/sections/cper-pci-bus.json
+++ b/specification/json/sections/cper-pci-bus.json
@@ -1,19 +1,7 @@
 {
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "type": "object",
-    "required": [
-        "errorStatus",
-        "errorType",
-        "busID",
-        "busAddress",
-        "busData",
-        "busCommandType",
-        "busRequestorID",
-        "busRequestorIDHex",
-        "busCompleterID",
-        "busCompleterIDHex",
-        "targetID"
-    ],
+    "required": [],
     "additionalProperties": false,
     "properties": {
         "errorStatus": {
diff --git a/specification/json/sections/cper-pci-component.json b/specification/json/sections/cper-pci-component.json
index 79abbb4..187e50f 100644
--- a/specification/json/sections/cper-pci-component.json
+++ b/specification/json/sections/cper-pci-component.json
@@ -1,13 +1,7 @@
 {
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "type": "object",
-    "required": [
-        "errorStatus",
-        "idInfo",
-        "memoryNumber",
-        "ioNumber",
-        "registerDataPairs"
-    ],
+    "required": [],
     "additionalProperties": false,
     "properties": {
         "errorStatus": {
diff --git a/specification/json/sections/cper-pcie.json b/specification/json/sections/cper-pcie.json
index 0ae27f2..2c2d42e 100644
--- a/specification/json/sections/cper-pcie.json
+++ b/specification/json/sections/cper-pcie.json
@@ -2,16 +2,7 @@
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "type": "object",
     "description": "PCI Express Error Section",
-    "required": [
-        "portType",
-        "version",
-        "commandStatus",
-        "deviceID",
-        "deviceSerialNumber",
-        "bridgeControlStatus",
-        "capabilityStructure",
-        "aerInfo"
-    ],
+    "required": [],
     "additionalProperties": false,
     "properties": {
         "portType": {
diff --git a/tests/meson.build b/tests/meson.build
index d9e9d96..81060a2 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -55,7 +55,7 @@
         gtest,
         gmock,
         nlohmann_json_dep,
-        valijson_dep
+        valijson_dep,
     ],
 )
 test('test-cper-tests', cper_tests)