From fcb3e7ea4ee79ca998e6ea9c0df08117e6397271 Mon Sep 17 00:00:00 2001 From: Arsenios Chatzigeorgiou <49944135+arschat@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:20:19 +0100 Subject: [PATCH] Add rule to restrict empty module --- json_schema/module/biomaterial/medical_tests.json | 1 + src/schema_linter.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/json_schema/module/biomaterial/medical_tests.json b/json_schema/module/biomaterial/medical_tests.json index ef5d4941..d219275f 100644 --- a/json_schema/module/biomaterial/medical_tests.json +++ b/json_schema/module/biomaterial/medical_tests.json @@ -5,6 +5,7 @@ "title": "Medical tests", "name": "medical_tests", "type": "object", + "minProperties": 1, "properties": { "describedBy": { "description": "The URL reference to the schema.", diff --git a/src/schema_linter.py b/src/schema_linter.py index 0404e028..c82d06f7 100644 --- a/src/schema_linter.py +++ b/src/schema_linter.py @@ -16,7 +16,7 @@ required_schema_fields = ['$schema', 'description', 'additionalProperties', 'title', 'name', 'type', 'properties'] -allowed_schema_fields = ['$schema', 'description', 'additionalProperties', 'required', 'title', 'name', 'type', 'properties', 'definitions', 'dependencies', 'if', 'then', 'else'] +allowed_schema_fields = ['$schema', 'description', 'additionalProperties', 'required', 'title', 'name', 'type', 'properties', 'definitions', 'dependencies', 'if', 'then', 'else', 'minProperties'] # Properties