schema: Add EMConfig
Entity Manager configuration documents can contain either a single
configuration (an object) or an array of that same object. Introduce a
new definition "EMConfig" which makes this obvious.
Change-Id: I3189743d218f8ae7a00a70c4f2295dcc449997ef
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/schemas/global.json b/schemas/global.json
index 0ffd78b..844f79a 100644
--- a/schemas/global.json
+++ b/schemas/global.json
@@ -1,39 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "Exposes": {
- "type": "array",
- "items": {
- "$ref": "legacy.json#/definitions/Aggregate"
- }
- },
- "Name": {
- "type": "string"
- },
- "Probe": {
- "type": "string"
- },
- "Type": {
- "type": "string"
- },
- "xyz.openbmc_project.Inventory.Decorator.Asset": {
- "$ref": "openbmc-dbus.json#/definitions/xyz/openbmc_project/Inventory/Decorator/Asset"
- }
- },
- "required": [
- "Exposes",
- "Name",
- "Probe",
- "xyz.openbmc_project.Inventory.Decorator.Asset"
- ]
- }
- },
- {
+ "definitions": {
+ "EMConfig": {
"type": "object",
"properties": {
"Exposes": {
@@ -80,5 +48,16 @@
"Probe"
]
}
+ },
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/EMConfig"
+ }
+ },
+ {
+ "$ref": "#/definitions/EMConfig"
+ }
]
}