schemas: Descriptions must be strings
```
$ python3 -c 'import json; import jsonschema; schema = json.load(open("schemas/global.json")); cls = jsonschema.validators.validator_for(schema); cls.check_schema(schema)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/jsonschema/validators.py", line 204, in check_schema
raise exceptions.SchemaError.create_from(error)
jsonschema.exceptions.SchemaError: ['The schema for an entity manager configuration file. An entity ', 'mananger configuration file can consist of a single object, or an ', 'array of objects. Objects must be of type EMConfig.'] is not of type 'string'
Failed validating 'type' in metaschema['properties']['description']:
{'type': 'string'}
On schema['description']:
['The schema for an entity manager configuration file. An entity ',
'mananger configuration file can consist of a single object, or an ',
'array of objects. Objects must be of type EMConfig.']
```
Change-Id: I2b8102e7d6047c8a7e624e182465065268fb8ad9
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/schemas/global.json b/schemas/global.json
index ab91c4d..5a8f95d 100644
--- a/schemas/global.json
+++ b/schemas/global.json
@@ -2,11 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"EMExposesElement": {
- "description": [
- "The exposes property element schema. An element of the exposes ",
- "property is always an array where elements are of type exposes ",
- "entry."
- ],
+ "description": "The exposes property element schema. An element of the exposes property is always an array where elements are of type exposes entry.",
"oneOf": [
{
"$ref": "ibm.json#/definitions/PowerModeProperties"
@@ -39,20 +35,14 @@
"$ref": "virtual_sensor.json#/definitions/VirtualSensor"
},
{
- "description": [
- "Ensure the parent oneOf schema does not validate ",
- "when an element does not define a type property."
- ],
+ "description": "Ensure the parent oneOf schema does not validate when an element does not define a type property.",
"not": {
"required": ["Type"]
},
"title": "Missing Type"
},
{
- "description": [
- "Ensure the parent oneOf schema does not validate ",
- "when an element does not define a name property."
- ],
+ "description": "Ensure the parent oneOf schema does not validate when an element does not define a name property.",
"not": {
"required": ["Name"]
},
@@ -63,13 +53,7 @@
},
"EMConfig": {
"title": "Entity Manager Configuration",
- "description": [
- "The schema for an entity manager configuration. An entity ",
- "manager configuration describes an association between a ",
- "match condition, also known as a probe, and an array of ",
- "heterogeneous configuration data. When a probe match ",
- "occurs, the configuration data is exported to DBus."
- ],
+ "description": "The schema for an entity manager configuration. An entity manager configuration describes an association between a match condition, also known as a probe, and an array of heterogeneous configuration data. When a probe match occurs, the configuration data is exported to DBus.",
"additionalProperties": false,
"type": "object",
"properties": {
@@ -77,13 +61,7 @@
"type": "string"
},
"Exposes": {
- "description": [
- "The schema for the exposes property. The exposes ",
- "property must be an array where elements are of ",
- "type EMExposesElement. The exposes property is the ",
- "heterogeneous configuration data exported to DBus ",
- "upon a probe match."
- ],
+ "description": "The schema for the exposes property. The exposes property must be an array where elements are of type EMExposesElement. The exposes property is the heterogeneous configuration data exported to DBus upon a probe match.",
"type": "array",
"items": {
"$ref": "#/definitions/EMExposesElement"
@@ -93,23 +71,11 @@
"enum": ["Off"]
},
"Name": {
- "description": [
- "The schema for the name property. The name property ",
- "identifies the configuration. When exported, the ",
- "configuration will be instantiated at: ",
- "/xyz/openbmc_project/configuration/<Type>/<Name>"
- ],
+ "description": "The schema for the name property. The name property identifies the configuration. When exported, the configuration will be instantiated at: /xyz/openbmc_project/configuration/<Type>/<Name>",
"type": "string"
},
"Probe": {
- "description": [
- "The schema for an entity manager probe statement. ",
- "Probes can be a single string or an array. Probes ",
- "describe a match condition, for example when a DBus ",
- "property has a specific value. When the match condition",
- " occurs, the information described by the Exposes ",
- "property is exported onto the DBus."
- ],
+ "description": "The schema for an entity manager probe statement. Probes can be a single string or an array. Probes describe a match condition, for example when a DBus property has a specific value. When the match condition occurs, the information described by the Exposes property is exported onto the DBus.",
"anyOf": [
{
"type": "string"
@@ -124,12 +90,7 @@
},
"Type": {
"title": "Configuration Type",
- "description": [
- "The schema for the type property. The type property",
- "identifies the type of the configuration. When exported,",
- "configurations will be instantiated as children of: ",
- "/xyz/openbmc_project/configuration/<Type>"
- ],
+ "description": "The schema for the type property. The type property identifies the type of the configuration. When exported, configurations will be instantiated as children of: /xyz/openbmc_project/configuration/<Type>",
"enum": ["Board", "Chassis", "NVMe", "PowerSupply"]
},
"xyz.openbmc_project.Common.UUID": {
@@ -170,11 +131,7 @@
}
},
"title": "Entity Manager Configuration File",
- "description": [
- "The schema for an entity manager configuration file. An entity ",
- "mananger configuration file can consist of a single object, or an ",
- "array of objects. Objects must be of type EMConfig."
- ],
+ "description": "The schema for an entity manager configuration file. An entity mananger configuration file can consist of a single object, or an array of objects. Objects must be of type EMConfig.",
"anyOf": [
{
"type": "array",
diff --git a/schemas/ibm.json b/schemas/ibm.json
index 840a407..4ecb6ec 100644
--- a/schemas/ibm.json
+++ b/schemas/ibm.json
@@ -3,14 +3,7 @@
"definitions": {
"IBMCFFPSConnector": {
"title": "IBM Common Form Factor (CFF) Power Supply connectors",
- "description": [
- "A schema associating an I2C endpoint and a GPIO for IBM CFF",
- "power supplies. In the entity-manager",
- "detector-configuration-reactor architecture, the daemon that",
- "supports IBM CFFPS is both a detector and reactor. It probes",
- "the endpoints described by this schema (reactor) and publishes",
- "the CFFPS FRU information (detector)."
- ],
+ "description": "A schema associating an I2C endpoint and a GPIO for IBM CFF power supplies. In the entity-manager detector-configuration-reactor architecture, the daemon that supports IBM CFFPS is both a detector and reactor. It probes the endpoints described by this schema (reactor) and publishes the CFFPS FRU information (detector).",
"type": "object",
"properties": {
"Name": {
@@ -20,22 +13,15 @@
"enum": ["IBMCFFPSConnector"]
},
"I2CBus": {
- "description": [
- "The I2C address on which to probe for a CFFPS."
- ],
+ "description": "The I2C address on which to probe for a CFFPS.",
"type": "number"
},
"I2CAddress": {
- "description": [
- "The I2C bus number on which to probe for a CFFPS."
- ],
+ "description": "The I2C bus number on which to probe for a CFFPS.",
"type": "number"
},
"NamedPresenceGpio": {
- "description": [
- "The name of the GPIO to monitor that indicates CFFPS",
- "plug state."
- ],
+ "description": "The name of the GPIO to monitor that indicates CFFPS plug state.",
"type": "string"
}
},
@@ -49,23 +35,7 @@
},
"IBMCompatibleSystem": {
"title": "System compatibility",
- "description": [
- "Devicetree-like compatibility strings for systems, where a",
- "'system' is roughly defined as the combination of a chassis and a",
- "mainboard.",
- "",
- "The strings should be used by applications to match the",
- "entity with entries or configuration in a hardware database.",
- "Strings appear in the list from most specific to most",
- "general. This allows an entity to express compatibility with",
- "a family of similar systems, in turn allowing an application",
- "to match a variety of systems with a single",
- "IBMCompatibleSystem entry.",
- "",
- "The recommended entry format is 'manufacturer,model' where",
- "the manufacturer is a string describing the name of the",
- "manufacturer and model specifies the model number."
- ],
+ "description": "Devicetree-like compatibility strings for systems, where a 'system' is roughly defined as the combination of a chassis and a mainboard. The strings should be used by applications to match the entity with entries or configuration in a hardware database. Strings appear in the list from most specific to most general. This allows an entity to express compatibility with a family of similar systems, in turn allowing an application to match a variety of systems with a single IBMCompatibleSystem entry. The recommended entry format is 'manufacturer,model' where the manufacturer is a string describing the name of the manufacturer and model specifies the model number.",
"type": "object",
"properties": {
"Name": {
@@ -92,58 +62,37 @@
},
"PowerModeProperties": {
"title": "PowerMode Properties",
- "description": ["The default PowerMode properties for the system"],
+ "description": "The default PowerMode properties for the system",
"type": "object",
"properties": {
"PowerMode": {
- "description": [
- "The default PowerMode to use prior to being set by a user."
- ],
+ "description": "The default PowerMode to use prior to being set by a user.",
"enum": ["Static", "PowerSaving", "MaximumPerformance"]
},
"IdlePowerSaverEnabled": {
- "description": [
- "Default state of idle power saver mode.",
- "Setting to true will enable idle power saver."
- ],
+ "description": "Default state of idle power saver mode. Setting to true will enable idle power saver.",
"type": "boolean"
},
"EnterUtilizationPercent": {
- "description": [
- "The default percentage of utilization that the system shall",
- "be lower than to enter idle power save.",
- "The value is in integer percentage values (10 = 10%).",
- "EnterUtilizationPercent must be <= ExitUtilizationPercent"
- ],
+ "description": "The default percentage of utilization that the system shall be lower than to enter idle power save. The value is in integer percentage values (10 = 10%). EnterUtilizationPercent must be <= ExitUtilizationPercent",
"type": "number",
"minimum": 1,
"maximum": 95
},
"EnterUtilizationDwellTime": {
- "description": [
- "The default duration in seconds that the system is below",
- "the EnterUtilizationPercent before idle power save is activated."
- ],
+ "description": "The default duration in seconds that the system is below the EnterUtilizationPercent before idle power save is activated.",
"type": "number",
"minimum": 10,
"maximum": 600
},
"ExitUtilizationPercent": {
- "description": [
- "The default percentage of utilization that the system shall",
- "be above in order to exit idle power save.",
- "The value is in integer percentage values (10 = 10%).",
- "ExitUtilizationPercent must be >= EnterUtilizationPercent"
- ],
+ "description": "The default percentage of utilization that the system shall be above in order to exit idle power save. The value is in integer percentage values (10 = 10%). ExitUtilizationPercent must be >= EnterUtilizationPercent",
"type": "number",
"minimum": 5,
"maximum": 95
},
"ExitUtilizationDwellTime": {
- "description": [
- "The default duration in seconds that the system is above",
- "the ExitUtilizationPercent before idle power save is deactivated."
- ],
+ "description": "The default duration in seconds that the system is above the ExitUtilizationPercent before idle power save is deactivated.",
"type": "number",
"minimum": 10,
"maximum": 600
diff --git a/schemas/legacy.json b/schemas/legacy.json
index 1752c3b..511799e 100644
--- a/schemas/legacy.json
+++ b/schemas/legacy.json
@@ -2,11 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"Aggregate": {
- "description": [
- "Don't add additional properties to this schema. Consult ",
- "README.schema for instructions on adding new Exposes element ",
- "sub-schema."
- ],
+ "description": "Don't add additional properties to this schema. Consult README.schema for instructions on adding new Exposes element sub-schema.",
"additionalProperties": false,
"properties": {
"Address": {
diff --git a/schemas/satellite_controller.json b/schemas/satellite_controller.json
index 8f364bf..3a6c4af 100644
--- a/schemas/satellite_controller.json
+++ b/schemas/satellite_controller.json
@@ -3,33 +3,27 @@
"definitions": {
"SatelliteController": {
"title": "satellite controller configuration",
- "description": [
- "The configuration used to add remote BMCs to a system"
- ],
+ "description": "The configuration used to add remote BMCs to a system",
"type": "object",
"properties": {
"Hostname": {
- "description": ["Hostname or IP of satellite controller"],
+ "description": "Hostname or IP of satellite controller",
"type": "string"
},
"Port": {
- "description": [
- "Network port to connect to satellite controller"
- ],
+ "description": "Network port to connect to satellite controller",
"type": "number"
},
"AuthType": {
- "description": [
- "Type of authorization to use with satellite controller"
- ],
+ "description": "Type of authorization to use with satellite controller",
"enum": ["None"]
},
"Name": {
- "description": ["The name of the object"],
+ "description": "The name of the object",
"type": "string"
},
"Type": {
- "description": ["The type of satellite controller"],
+ "description": "The type of satellite controller",
"enum": ["SatelliteController"]
}
},
diff --git a/schemas/virtual_sensor.json b/schemas/virtual_sensor.json
index 77c39c9..512ea85 100644
--- a/schemas/virtual_sensor.json
+++ b/schemas/virtual_sensor.json
@@ -3,62 +3,46 @@
"definitions": {
"VirtualSensor": {
"title": "phosphor-virtual-sensor configuration",
- "description": [
- "The configuration used by the virtual-sensor daemon",
- "in the phosphor-virtual-sensor repository. Virtual",
- "sensors are xyz.openbmc_project.Sensor.Value D-Bus",
- "objects that have sensor values calculated from the",
- "D-Bus sensors listed here."
- ],
+ "description": "The configuration used by the virtual-sensor daemon in the phosphor-virtual-sensor repository. Virtual sensors are xyz.openbmc_project.Sensor.Value D-Bus objects that have sensor values calculated from the D-Bus sensors listed here.",
"type": "object",
"properties": {
"MaxValidInput": {
- "description": ["Maximum valid value of an input sensor"],
+ "description": "Maximum valid value of an input sensor",
"type": "number"
},
"MaxValue": {
- "description": ["Maximum sensor value"],
+ "description": "Maximum sensor value",
"$ref": "legacy.json#/definitions/Types/MaxValue"
},
"MinValidInput": {
- "description": ["Miniumum valid value of an input sensor"],
+ "description": "Miniumum valid value of an input sensor",
"type": "number"
},
"MinValue": {
- "description": ["Minimum sensor value"],
+ "description": "Minimum sensor value",
"$ref": "legacy.json#/definitions/Types/MinValue"
},
"Name": {
"type": "string"
},
"Sensors": {
- "description": [
- "Any DBus sensors whose values are used to",
- "determine the value of the virtual sensor."
- ],
+ "description": "Any DBus sensors whose values are used to determine the value of the virtual sensor.",
"items": {
"type": "string"
},
"type": "array"
},
"Thresholds": {
- "description": [
- "Threshold values used to set and clear alarms"
- ],
+ "description": "Threshold values used to set and clear alarms",
"$ref": "legacy.json#/definitions/Types/Thresholds"
},
"Type": {
- "description": [
- "The type of calculation this sensor uses."
- ],
+ "description": "The type of calculation this sensor uses.",
"type": "string",
"enum": ["ModifiedMedian", "Maximum"]
},
"Units": {
- "description": [
- "The sensor type, as it shows up in the D-Bus",
- "object name."
- ],
+ "description": "The sensor type, as it shows up in the D-Bus object name.",
"$ref": "legacy.json#/definitions/Types/Units"
}
},