Add CPER conversion for single section records.
diff --git a/specification/document/cper-json-specification.tex b/specification/document/cper-json-specification.tex
index ac54dc9..8f814b6 100644
--- a/specification/document/cper-json-specification.tex
+++ b/specification/document/cper-json-specification.tex
@@ -51,19 +51,31 @@
% Specification section.
\chapter{Main Structure Specification}
-\section{Parent Structure}
-\label{section:parentstructure}
+\section{Parent Structure (Type 1): Full Log}
+\label{section:parentstructuretype1}
This structure contains descriptions of the CPER log header, as well as the section descriptors and
-section structures themselves within arrays. This is the structure returned by \texttt{cper\_to\_ir(FILE* cper\_file)} as JSON IR.
+section structures themselves within arrays, representing a full CPER log. This is the structure returned by \texttt{cper\_to\_ir(FILE* cper\_file)} as JSON IR.
-% Parent structure table.
-\jsontable{table:parentstructure}
+% Parent structure (type 1) table.
+\jsontable{table:parentstructuretype1}
header & object & A CPER header structure as defined in Section \ref{section:headerstructure}. \\
\hline
sectionDescriptors & array & An array of section descriptor objects as defined in Section \ref{section:sectiondescriptorstructure}. \\
\hline
sections & array & An array of section objects as defined in Chapter \ref{chapter:sectionchapter}. These sections are at the same index as their corresponding section descriptor within the \texttt{sectionDescriptors} array.\\
-\jsontableend{Parent structure field table.}
+\jsontableend{Parent structure (type 1) field table.}
+
+\section{Parent Structure (Type 2): Single Section Log}
+\label{section:parentstructuretype2}
+This structure contains a single section descriptor and section, representing a single section CPER log.
+This is the structure returned by \texttt{cper\_single\_section\_to\_ir(FILE* cper\_file)} as JSON IR.
+
+% Parent structure (type 2) table.
+\jsontable{table:parentstructuretype2}
+sectionDescriptor & object & A section descriptor object as defined in Section \ref{section:sectiondescriptorstructure}. \\
+\hline
+sections & array & A section object as defined in Chapter \ref{chapter:sectionchapter}.\\
+\jsontableend{Parent structure (type 2) field table.}
% Header structure.
\section{Header Structure}
diff --git a/specification/json/cper-json-full-log.json b/specification/json/cper-json-full-log.json
new file mode 100644
index 0000000..a34ceb3
--- /dev/null
+++ b/specification/json/cper-json-full-log.json
@@ -0,0 +1,41 @@
+{
+ "type": "object",
+ "required": ["header", "sectionDescriptors", "sections"],
+ "additionalProperties": false,
+ "properties": {
+ "header": {
+ "$ref": "./cper-json-header.json"
+ },
+ "sectionDescriptors": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "$ref": "./cper-json-section-descriptor.json"
+ }
+ },
+ "sections": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "oneOf": [
+ { "$ref": "./sections/cper-generic-processor.json" },
+ { "$ref": "./sections/cper-ia32x64-processor.json" },
+ { "$ref": "./sections/cper-arm-processor.json" },
+ { "$ref": "./sections/cper-memory.json" },
+ { "$ref": "./sections/cper-memory2.json" },
+ { "$ref": "./sections/cper-pcie.json" },
+ { "$ref": "./sections/cper-pci-bus.json" },
+ { "$ref": "./sections/cper-pci-component.json" },
+ { "$ref": "./sections/cper-firmware.json" },
+ { "$ref": "./sections/cper-generic-dmar.json" },
+ { "$ref": "./sections/cper-vtd-dmar.json" },
+ { "$ref": "./sections/cper-iommu-dmar.json" },
+ { "$ref": "./sections/cper-ccix-per.json" },
+ { "$ref": "./sections/cper-cxl-protocol.json" },
+ { "$ref": "./sections/cper-cxl-component.json" },
+ { "$ref": "./sections/cper-unknown.json" }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/json/cper-json-section-log.json b/specification/json/cper-json-section-log.json
new file mode 100644
index 0000000..151f6a6
--- /dev/null
+++ b/specification/json/cper-json-section-log.json
@@ -0,0 +1,34 @@
+{
+ "type": "object",
+ "required": ["sectionDescriptor", "section"],
+ "additionalProperties": false,
+ "properties": {
+ "header": {
+ "$ref": "./cper-json-header.json"
+ },
+ "sectionDescriptor": {
+ "$ref": "./cper-json-section-descriptor.json"
+ },
+ "section": {
+ "type": "object",
+ "oneOf": [
+ { "$ref": "./sections/cper-generic-processor.json" },
+ { "$ref": "./sections/cper-ia32x64-processor.json" },
+ { "$ref": "./sections/cper-arm-processor.json" },
+ { "$ref": "./sections/cper-memory.json" },
+ { "$ref": "./sections/cper-memory2.json" },
+ { "$ref": "./sections/cper-pcie.json" },
+ { "$ref": "./sections/cper-pci-bus.json" },
+ { "$ref": "./sections/cper-pci-component.json" },
+ { "$ref": "./sections/cper-firmware.json" },
+ { "$ref": "./sections/cper-generic-dmar.json" },
+ { "$ref": "./sections/cper-vtd-dmar.json" },
+ { "$ref": "./sections/cper-iommu-dmar.json" },
+ { "$ref": "./sections/cper-ccix-per.json" },
+ { "$ref": "./sections/cper-cxl-protocol.json" },
+ { "$ref": "./sections/cper-cxl-component.json" },
+ { "$ref": "./sections/cper-unknown.json" }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/specification/json/cper-json.json b/specification/json/cper-json.json
index 302adc9..6d0e755 100644
--- a/specification/json/cper-json.json
+++ b/specification/json/cper-json.json
@@ -3,42 +3,8 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "JSON Schema for the CPER-JSON format, as described in the CPER-JSON specification document.",
"type": "object",
- "required": ["header", "sectionDescriptors", "sections"],
- "additionalProperties": false,
- "properties": {
- "header": {
- "$ref": "./cper-json-header.json"
- },
- "sectionDescriptors": {
- "type": "array",
- "items": {
- "type": "object",
- "$ref": "./cper-json-section-descriptor.json"
- }
- },
- "sections": {
- "type": "array",
- "items": {
- "type": "object",
- "oneOf": [
- { "$ref": "./sections/cper-generic-processor.json" },
- { "$ref": "./sections/cper-ia32x64-processor.json" },
- { "$ref": "./sections/cper-arm-processor.json" },
- { "$ref": "./sections/cper-memory.json" },
- { "$ref": "./sections/cper-memory2.json" },
- { "$ref": "./sections/cper-pcie.json" },
- { "$ref": "./sections/cper-pci-bus.json" },
- { "$ref": "./sections/cper-pci-component.json" },
- { "$ref": "./sections/cper-firmware.json" },
- { "$ref": "./sections/cper-generic-dmar.json" },
- { "$ref": "./sections/cper-vtd-dmar.json" },
- { "$ref": "./sections/cper-iommu-dmar.json" },
- { "$ref": "./sections/cper-ccix-per.json" },
- { "$ref": "./sections/cper-cxl-protocol.json" },
- { "$ref": "./sections/cper-cxl-component.json" },
- { "$ref": "./sections/cper-unknown.json" }
- ]
- }
- }
- }
+ "oneOf": [
+ { "$ref": "./cper-json-full-log.json" },
+ { "$ref": "./cper-json-section-log.json" }
+ ]
}
\ No newline at end of file