Remove validation bits

Discard invalid properties from json decode. JSON output should only
contain valid properties. This saves time in preventing post
processing of output for valid fields.

Ensure round trip validity with validation bits removed and required
properties populated.

Fix bugs in json decode.

Overhaul unit tests to use valijson. Add tests with static examples
to validate against schema. Use and nlohmann for better schema
validation over intrinsic libcper validation.

Example json output before:
{
  "ValidationBits": {
    "LevelValid": false,
    "CorrectedValid": true
  },
  "Level": 1,
  "Corrected": true
}

After:
{
  "Corrected": true
}

Change-Id: I188bdc2827a57d938c22a431238fadfcdc939ab8
Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>
diff --git a/generator/sections/gen-section-cxl-component.c b/generator/sections/gen-section-cxl-component.c
index 395defb..615a152 100644
--- a/generator/sections/gen-section-cxl-component.c
+++ b/generator/sections/gen-section-cxl-component.c
@@ -11,7 +11,8 @@
 
 //Generates a single pseudo-random CXL component error section, saving the resulting address to the given
 //location. Returns the size of the newly created section.
-size_t generate_section_cxl_component(void **location)
+size_t generate_section_cxl_component(void **location,
+				      GEN_VALID_BITS_TEST_TYPE validBitsType)
 {
 	//Create a random length for the CXL component event log.
 	//The logs attached here do not necessarily conform to the specification, and are simply random.
@@ -24,6 +25,11 @@
 	//Set reserved areas to zero.
 	UINT32 *validation = (UINT32 *)(bytes + 4);
 	*validation &= 0x7;
+	if (validBitsType == ALL_VALID) {
+		*validation = 0x7;
+	} else if (validBitsType == SOME_VALID) {
+		*validation = 0x5;
+	}
 	*(validation + 1) = 0;
 	UINT8 *slot_number = (UINT8 *)(bytes + 21);
 	*slot_number &= ~0x7; //Device ID slot number bits 0-2.