regulators: Standardize arrays in schema

Standardize the definition of arrays of objects in the JSON config file
schema.

When an array contains objects as elements, then both the array and
the object type need to be defined in the schema.

Currently the schema definitions for arrays of objects are inconsistent.
Sometimes the object type is defined at the same time as the array, and
sometimes the array references a separate object type.

Standardize the schema so that all array definitions reference a
separate object type.  This makes the array definition simpler, and it
makes the object type reusable.

Also standardize use of white space in several places where it was
inconsistent in the file.

Tested:
* Ran automated schema tests.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: If972c2a599e665e94f37e8942239074e2ec19c41
diff --git a/phosphor-regulators/schema/config_schema.json b/phosphor-regulators/schema/config_schema.json
index ef4c074..d18da6d 100644
--- a/phosphor-regulators/schema/config_schema.json
+++ b/phosphor-regulators/schema/config_schema.json
@@ -6,48 +6,38 @@
     "type": "object",
     "properties":
     {
-        "comments":
-        {
-            "$ref": "#/definitions/comments"
-        },
-        "rules":
-        {
-            "$ref": "#/definitions/rules"
-        },
-        "chassis":
-        {
-            "$ref": "#/definitions/chassis"
-        }
+        "comments": {"$ref": "#/definitions/comments" },
+        "rules": {"$ref": "#/definitions/rules" },
+        "chassis": {"$ref": "#/definitions/chassis" }
     },
     "required": ["chassis"],
     "additionalProperties": false,
     "definitions":
     {
+        "rule":
+        {
+            "type": "object",
+            "properties":
+            {
+                "comments": {"$ref": "#/definitions/comments" },
+                "id": {"$ref": "#/definitions/id" },
+                "actions": {"$ref": "#/definitions/actions" }
+            },
+            "required": ["id", "actions"],
+            "additionalProperties": false
+        },
+
         "rules":
         {
             "type": "array",
-            "items":
-            {
-                "type": "object",
-                "properties":
-                {
-                    "comments": {"$ref": "#/definitions/comments" },
-                    "id": {"$ref": "#/definitions/id" },
-                    "actions": {"$ref": "#/definitions/actions" }
-                },
-                "required": ["id", "actions"],
-                "additionalProperties": false
-            },
+            "items": {"$ref": "#/definitions/rule" },
             "minItems": 1
         },
 
         "comments":
         {
             "type": "array",
-            "items":
-            {
-                "type": "string"
-            },
+            "items": {"type": "string" },
             "minItems": 1
         },
 
@@ -325,22 +315,24 @@
             "enum": ["linear_11", "linear_16"]
         },
 
+        "chassis_object":
+        {
+            "type": "object",
+            "properties":
+            {
+                "comments": {"$ref": "#/definitions/comments" },
+                "number": {"$ref": "#/definitions/number" },
+                "inventory_path": {"$ref": "#/definitions/inventory_path" },
+                "devices": {"$ref": "#/definitions/devices" }
+            },
+            "required": ["number"],
+            "additionalProperties": false
+        },
+
         "chassis":
         {
             "type": "array",
-            "items":
-            {
-                "type": "object",
-                "properties":
-                {
-                    "comments": {"$ref": "#/definitions/comments" },
-                    "number": {"$ref": "#/definitions/number" },
-                    "inventory_path": {"$ref": "#/definitions/inventory_path" },
-                    "devices": {"$ref": "#/definitions/devices" }
-                },
-                "required": ["number"],
-                "additionalProperties": false
-            },
+            "items": {"$ref": "#/definitions/chassis_object" },
             "minItems": 1
         },
 
@@ -350,34 +342,36 @@
             "minimum": 1
         },
 
+        "device":
+        {
+            "type": "object",
+            "properties":
+            {
+                "comments": {"$ref": "#/definitions/comments" },
+                "id": {"$ref": "#/definitions/id" },
+                "is_regulator": {"$ref": "#/definitions/is_regulator" },
+                "fru": {"$ref": "#/definitions/inventory_path" },
+                "i2c_interface": {"$ref": "#/definitions/i2c_interface" },
+                "presence_detection": {"$ref": "#/definitions/presence_detection" },
+                "configuration": {"$ref": "#/definitions/configuration" },
+                "rails": {"$ref": "#/definitions/rails" }
+            },
+            "required": ["id", "is_regulator", "fru", "i2c_interface"],
+            "if":
+            {
+                "properties": { "is_regulator": { "const": false } }
+            },
+            "then":
+            {
+                "not" : { "required" : ["rails"] }
+            },
+            "additionalProperties": false
+        },
+
         "devices":
         {
             "type": "array",
-            "items":
-            {
-                "type": "object",
-                "properties":
-                {
-                    "comments": {"$ref": "#/definitions/comments" },
-                    "id": {"$ref": "#/definitions/id" },
-                    "is_regulator": {"$ref": "#/definitions/is_regulator" },
-                    "fru": {"$ref": "#/definitions/inventory_path" },
-                    "i2c_interface": {"$ref": "#/definitions/i2c_interface" },
-                    "presence_detection": {"$ref": "#/definitions/presence_detection" },
-                    "configuration": {"$ref": "#/definitions/configuration" },
-                    "rails": {"$ref": "#/definitions/rails" }
-                },
-                "required": ["id", "is_regulator", "fru", "i2c_interface"],
-                "if":
-                {
-                    "properties": { "is_regulator": { "const": false } }
-                },
-                "then":
-                {
-                    "not" : { "required" : ["rails"] }
-                },
-                "additionalProperties": false
-            },
+            "items": {"$ref": "#/definitions/device" },
             "minItems": 1
         },