From 2423bee51bef7c3ae0a29049b8a6a572f9753ca8 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 2 Mar 2023 08:00:32 +0000 Subject: [PATCH] Switch JSON schema to draft-7 As the support for the very old draft-4 was removed from at least one critical tool (ajv), we switch to draft-7 which also happens to be the version used by all the other Ansible related schemas. Related: https://github.com/ajv-validator/ajv/issues/472 Related: https://github.com/ansible/ansible-lint/issues/3079 Related: https://github.com/ansible/ansible-rulebook/issues/397 We also include the "examples" extension, which informs ansible-lint about which glob file patters should use this schema. --- ansible_rulebook/schema/ruleset_schema.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ansible_rulebook/schema/ruleset_schema.json b/ansible_rulebook/schema/ruleset_schema.json index 1a2d93999..e152e5504 100644 --- a/ansible_rulebook/schema/ruleset_schema.json +++ b/ansible_rulebook/schema/ruleset_schema.json @@ -1,9 +1,10 @@ { - "$schema": "https://json-schema.org/draft-04/schema", + "$schema": "https://json-schema.org/draft-07/schema", "$id": "https://raw.githubusercontent.com/ansible/ansible-rulebook/main/ansible_rulebook/schema/ruleset_schema.json", "type": "array", "items": {"$ref": "#/$defs/ruleset"}, "minItems": 1, + "examples": ["rulebooks/*.yml", "rulebooks/*.yaml"], "$defs": { "ruleset": { "type": "object", @@ -312,7 +313,7 @@ }, "required": [ "fact" - ], + ], "additionalProperties": false } }, @@ -329,7 +330,7 @@ "properties": { "var_root": {"type": ["string","object"] }, "pretty": {"type": "boolean" } - }, + }, "additionalProperties": false } },