schemas: fix leak_detector.json
'Type' has to be const or enum to allow an Exposes record to be mapped
to a schema without ambiguity.
Change 'Polarity' property to use the existing schema for polarity.
That will impact the code but apparently no configurations currently
exist for this schema. That can be checked by grepping for 'Level' in
configurations, which is a required property on the schema.
Tested: Schema Validator Pass
Change-Id: I6fe2ecec45ba1b13a3c2873d41f640dd25a28387
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/schemas/leak_detector.json b/schemas/leak_detector.json
index d37531a..a86894d 100644
--- a/schemas/leak_detector.json
+++ b/schemas/leak_detector.json
@@ -2,6 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$defs": {
"GPIOLeakDetector": {
+ "additionalProperties": false,
"description": "Configuration for GPIO based Leak Detector.",
"type": "object",
"properties": {
@@ -11,7 +12,7 @@
},
"Type": {
"description": "The type of configuration object",
- "type": "string"
+ "const": "GPIOLeakDetector"
},
"SubType": {
"description": "The type of leak detector.",
@@ -23,7 +24,7 @@
},
"Polarity": {
"description": "The GPIO polarity depicting its active status.",
- "enum": ["ActiveLow", "ActiveHigh"]
+ "$ref": "legacy.json#/$defs/Types/Polarity"
},
"Level": {
"description": "The severity level of the leak detector.",