schema: factor out dbus

Move schema that validate OpenBMC DBus interfaces to a single file to
facilitate re-use and improve organization.  Perhaps this file could be
generated from the canonical DBus documentation for OpenBMC.

Change-Id: If02cbf1b646d39b6e71f4c6e595d1992bc71ef92
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meson.build b/meson.build
index 2425696..3f4826e 100644
--- a/meson.build
+++ b/meson.build
@@ -113,6 +113,7 @@
 schemas = [
     'global.json',
     'legacy.json',
+    'openbmc-dbus.json',
     'Pid.json',
     'Pid.Zone.json',
     'Stepwise.json',
diff --git a/schemas/global.json b/schemas/global.json
index b135a5c..0ffd78b 100644
--- a/schemas/global.json
+++ b/schemas/global.json
@@ -22,27 +22,7 @@
                         "type": "string"
                     },
                     "xyz.openbmc_project.Inventory.Decorator.Asset": {
-                        "type": "object",
-                        "properties": {
-                            "Manufacturer": {
-                                "type": "string"
-                            },
-                            "Model": {
-                                "type": "string"
-                            },
-                            "PartNumber": {
-                                "type": "string"
-                            },
-                            "SerialNumber": {
-                                "type": "string"
-                            }
-                        },
-                        "required": [
-                            "Manufacturer",
-                            "Model",
-                            "PartNumber",
-                            "SerialNumber"
-                        ]
+                        "$ref": "openbmc-dbus.json#/definitions/xyz/openbmc_project/Inventory/Decorator/Asset"
                     }
                 },
                 "required": [
@@ -82,44 +62,16 @@
                     "type": "string"
                 },
                 "xyz.openbmc_project.Inventory.Decorator.Asset": {
-                    "type": "object",
-                    "properties": {
-                        "Manufacturer": {
-                            "type": "string"
-                        },
-                        "Model": {
-                            "type": "string"
-                        },
-                        "PartNumber": {
-                            "type": "string"
-                        },
-                        "SerialNumber": {
-                            "type": "string"
-                        }
-                    },
-                    "required": [
-                        "Manufacturer",
-                        "Model",
-                        "PartNumber",
-                        "SerialNumber"
-                    ]
+                    "$ref": "openbmc-dbus.json#/definitions/xyz/openbmc_project/Inventory/Decorator/Asset"
                 },
                 "ProductId": {
                     "type": "number"
                 },
                 "xyz.openbmc_project.Inventory.Decorator.AssetTag": {
-                    "type": "object",
-                    "properties": {
-                        "AssetTag": {
-                            "type": "string"
-                        }
-                    },
-                    "required": [
-                        "AssetTag"
-                    ]
+                    "$ref": "openbmc-dbus.json#/definitions/xyz/openbmc_project/Inventory/Decorator/AssetTag"
                 },
                 "xyz.openbmc_project.Inventory.Item.System": {
-                    "type": "object"
+                    "$ref": "openbmc-dbus.json#/definitions/xyz/openbmc_project/Inventory/Item/System"
                 }
             },
             "required": [
diff --git a/schemas/openbmc-dbus.json b/schemas/openbmc-dbus.json
new file mode 100644
index 0000000..853064c
--- /dev/null
+++ b/schemas/openbmc-dbus.json
@@ -0,0 +1,56 @@
+{
+    "$schema": "http://json-schema.org/draft-07/schema#",
+    "title": "Schemas for JSON representations of OpenBMC DBus interfaces",
+    "definitions": {
+        "xyz": {
+            "openbmc_project": {
+                "Inventory": {
+                    "Decorator": {
+                        "Asset": {
+                            "additionalProperties": false,
+                            "properties": {
+                                "Manufacturer": {
+                                    "type": "string"
+                                },
+                                "Model": {
+                                    "type": "string"
+                                },
+                                "PartNumber": {
+                                    "type": "string"
+                                },
+                                "SerialNumber": {
+                                    "type": "string"
+                                }
+                            },
+                            "required": [
+                                "Manufacturer",
+                                "Model",
+                                "PartNumber",
+                                "SerialNumber"
+                            ],
+                            "type": "object"
+                        },
+                        "AssetTag": {
+                            "additionalProperties": false,
+                            "properties": {
+                                "AssetTag": {
+                                    "type": "string"
+                                }
+                            },
+                            "required": [
+                                "AssetTag"
+                            ],
+                            "type": "object"
+                        }
+                    },
+                    "Item": {
+                        "System": {
+                            "additionalProperties": false,
+                            "type": "object"
+                        }
+                    }
+                }
+            }
+        }
+    }
+}