Skip to content

Commit

Permalink
Switch JSON schema to draft-7
Browse files Browse the repository at this point in the history
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: ajv-validator/ajv#472
Related: ansible/ansible-lint#3079
Related: ansible#397

We also include the "examples" extension, which informs ansible-lint
about which glob file patters should use this schema.
  • Loading branch information
ssbarnea committed Mar 2, 2023
1 parent 2e3d10b commit 2423bee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ansible_rulebook/schema/ruleset_schema.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -312,7 +313,7 @@
},
"required": [
"fact"
],
],
"additionalProperties": false
}
},
Expand All @@ -329,7 +330,7 @@
"properties": {
"var_root": {"type": ["string","object"] },
"pretty": {"type": "boolean" }
},
},
"additionalProperties": false
}
},
Expand Down

0 comments on commit 2423bee

Please sign in to comment.