mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2025-11-02 02:57:55 +00:00
schema: add third-party support
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -33,3 +33,6 @@ properties:
|
|||||||
$ref: "https://ucentral.io/schema/v1/metrics/"
|
$ref: "https://ucentral.io/schema/v1/metrics/"
|
||||||
config-raw:
|
config-raw:
|
||||||
$ref: "https://ucentral.io/schema/v1/config-raw/"
|
$ref: "https://ucentral.io/schema/v1/config-raw/"
|
||||||
|
third-party:
|
||||||
|
type: object
|
||||||
|
additionalProperties: true
|
||||||
|
|||||||
@@ -5119,6 +5119,23 @@ function newUCentralState(location, value, errors) {
|
|||||||
obj.config_raw = instantiateConfigRaw(location + "/config-raw", value["config-raw"], errors);
|
obj.config_raw = instantiateConfigRaw(location + "/config-raw", value["config-raw"], errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseThirdParty(location, value, errors) {
|
||||||
|
if (type(value) == "object") {
|
||||||
|
let obj = { ...value };
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type(value) != "object")
|
||||||
|
push(errors, [ location, "must be of type object" ]);
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exists(value, "third-party")) {
|
||||||
|
obj.third_party = parseThirdParty(location + "/third-party", value["third-party"], errors);
|
||||||
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,10 @@
|
|||||||
},
|
},
|
||||||
"config-raw": {
|
"config-raw": {
|
||||||
"$ref": "#/$defs/config-raw"
|
"$ref": "#/$defs/config-raw"
|
||||||
|
},
|
||||||
|
"third-party": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"$defs": {
|
"$defs": {
|
||||||
|
|||||||
Reference in New Issue
Block a user