From 674a7c10d181f37d1b2baeae2b6e9c657bec428c Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 16 Oct 2021 21:05:58 +1030 Subject: [PATCH] Fix check.py --- check.py | 2 +- schemas/appliance_v3.json | 7 +++++++ schemas/appliance_v4.json | 6 ++++++ schemas/appliance_v5.json | 6 ++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/check.py b/check.py index c6bffa2..cb4e23c 100644 --- a/check.py +++ b/check.py @@ -78,7 +78,7 @@ def check_appliance(appliance): schema_filename = "schemas/appliance_v{}.json".format(version) with open(schema_filename) as f: schemas[version] = json.load(f) - #no_additional_properties(schemas[version]) + no_additional_properties(schemas[version]) with open(os.path.join('appliances', appliance)) as f: appliance_json = json.load(f) diff --git a/schemas/appliance_v3.json b/schemas/appliance_v3.json index 70ce1f6..2b5c9c2 100644 --- a/schemas/appliance_v3.json +++ b/schemas/appliance_v3.json @@ -14,6 +14,12 @@ }, "properties": { + "appliance_id": { + "type": "string", + "minLength": 36, + "maxLength": 36, + "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + }, "name": { "type": "string", "title": "Appliance name" @@ -430,6 +436,7 @@ } } }, + "additionalProperties": false, "required": [ "name", "category", diff --git a/schemas/appliance_v4.json b/schemas/appliance_v4.json index 7a2477d..4f27419 100644 --- a/schemas/appliance_v4.json +++ b/schemas/appliance_v4.json @@ -14,6 +14,12 @@ }, "properties": { + "appliance_id": { + "type": "string", + "minLength": 36, + "maxLength": 36, + "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + }, "name": { "type": "string", "title": "Appliance name" diff --git a/schemas/appliance_v5.json b/schemas/appliance_v5.json index 96925a6..790e3ec 100644 --- a/schemas/appliance_v5.json +++ b/schemas/appliance_v5.json @@ -14,6 +14,12 @@ }, "properties": { + "appliance_id": { + "type": "string", + "minLength": 36, + "maxLength": 36, + "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + }, "name": { "type": "string", "title": "Appliance name"