diff options
Diffstat (limited to '')
76 files changed, 931 insertions, 17 deletions
diff --git a/test/schemas/negative_test/.ansible-lint.md b/test/schemas/negative_test/.ansible-lint.md index f1f2308..7746f3c 100644 --- a/test/schemas/negative_test/.ansible-lint.md +++ b/test/schemas/negative_test/.ansible-lint.md @@ -128,6 +128,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [], "parse_errors": [ { diff --git a/test/schemas/negative_test/.config/ansible-lint.yml.md b/test/schemas/negative_test/.config/ansible-lint.yml.md index 4fe331e..8d055af 100644 --- a/test/schemas/negative_test/.config/ansible-lint.yml.md +++ b/test/schemas/negative_test/.config/ansible-lint.yml.md @@ -29,6 +29,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/.config/ansible-lint.yml", diff --git a/test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml.md b/test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml.md index 72b4f96..82b2601 100644 --- a/test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml.md +++ b/test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/changelogs/invalid-date/changelogs/changelog.yaml", diff --git a/test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml.md b/test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml.md index ef847c3..f9cbc03 100644 --- a/test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml.md +++ b/test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml", diff --git a/test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml.md b/test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml.md index 5938944..c21eca7 100644 --- a/test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml.md +++ b/test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/changelogs/list/changelogs/changelog.yaml", diff --git a/test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml.md b/test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml.md index 64c4665..9acc793 100644 --- a/test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml.md +++ b/test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/changelogs/no-semver/changelogs/changelog.yaml", diff --git a/test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml.md b/test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml.md index 490bdbe..35cf572 100644 --- a/test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml.md +++ b/test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/changelogs/unknown-keys/changelogs/changelog.yaml", diff --git a/test/schemas/negative_test/galaxy_1/galaxy.yml.md b/test/schemas/negative_test/galaxy_1/galaxy.yml.md index bbb79ec..0119fbe 100644 --- a/test/schemas/negative_test/galaxy_1/galaxy.yml.md +++ b/test/schemas/negative_test/galaxy_1/galaxy.yml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/galaxy_1/galaxy.yml", diff --git a/test/schemas/negative_test/inventory/broken_dev_inventory.yml.md b/test/schemas/negative_test/inventory/broken_dev_inventory.yml.md index d4fefaf..1979297 100644 --- a/test/schemas/negative_test/inventory/broken_dev_inventory.yml.md +++ b/test/schemas/negative_test/inventory/broken_dev_inventory.yml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/inventory/broken_dev_inventory.yml", diff --git a/test/schemas/negative_test/meta/runtime.yml.md b/test/schemas/negative_test/meta/runtime.yml.md index 761fa6f..45dfc74 100644 --- a/test/schemas/negative_test/meta/runtime.yml.md +++ b/test/schemas/negative_test/meta/runtime.yml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/meta/runtime.yml", diff --git a/test/schemas/negative_test/molecule/platforms_children/molecule.yml.md b/test/schemas/negative_test/molecule/platforms_children/molecule.yml.md index 68e09eb..5c0320e 100644 --- a/test/schemas/negative_test/molecule/platforms_children/molecule.yml.md +++ b/test/schemas/negative_test/molecule/platforms_children/molecule.yml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/molecule/platforms_children/molecule.yml", diff --git a/test/schemas/negative_test/molecule/platforms_networks/molecule.yml.md b/test/schemas/negative_test/molecule/platforms_networks/molecule.yml.md index 74b8de7..8ecbddf 100644 --- a/test/schemas/negative_test/molecule/platforms_networks/molecule.yml.md +++ b/test/schemas/negative_test/molecule/platforms_networks/molecule.yml.md @@ -30,6 +30,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/molecule/platforms_networks/molecule.yml", diff --git a/test/schemas/negative_test/playbooks/environment.yml.md b/test/schemas/negative_test/playbooks/environment.yml.md index 8923cb3..b34d039 100644 --- a/test/schemas/negative_test/playbooks/environment.yml.md +++ b/test/schemas/negative_test/playbooks/environment.yml.md @@ -91,6 +91,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/environment.yml", @@ -101,6 +102,11 @@ stdout: "path": "$[0]", "message": "'environment', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].environment", + "message": "'{{ foo }}-123' is not of type 'object'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/failed_when.yml.md b/test/schemas/negative_test/playbooks/failed_when.yml.md index e843e1f..c1c6e6c 100644 --- a/test/schemas/negative_test/playbooks/failed_when.yml.md +++ b/test/schemas/negative_test/playbooks/failed_when.yml.md @@ -118,6 +118,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/failed_when.yml", @@ -128,6 +129,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tasks[0].failed_when", + "message": "123 is not of type 'boolean'" + }, + "num_sub_errors": 9, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/gather_facts.yml.md b/test/schemas/negative_test/playbooks/gather_facts.yml.md index 0eb3a4b..6b8d90a 100644 --- a/test/schemas/negative_test/playbooks/gather_facts.yml.md +++ b/test/schemas/negative_test/playbooks/gather_facts.yml.md @@ -63,7 +63,25 @@ "params": { "type": "boolean" }, - "schemaPath": "#/properties/gather_facts/type" + "schemaPath": "#/oneOf/0/type" + }, + { + "instancePath": "/0/gather_facts", + "keyword": "pattern", + "message": "must match pattern \"^\\{[\\{%](.|[\r\n])*[\\}%]\\}$\"", + "params": { + "pattern": "^\\{[\\{%](.|[\r\n])*[\\}%]\\}$" + }, + "schemaPath": "#/$defs/full-jinja/pattern" + }, + { + "instancePath": "/0/gather_facts", + "keyword": "oneOf", + "message": "must match exactly one schema in oneOf", + "params": { + "passingSchemas": null + }, + "schemaPath": "#/oneOf" }, { "instancePath": "/0", @@ -84,6 +102,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/gather_facts.yml", @@ -94,6 +113,11 @@ stdout: "path": "$[0]", "message": "'gather_facts', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].gather_facts", + "message": "'non' is not of type 'boolean'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0]", @@ -113,7 +137,15 @@ stdout: }, { "path": "$[0].gather_facts", + "message": "'non' is not valid under any of the given schemas" + }, + { + "path": "$[0].gather_facts", "message": "'non' is not of type 'boolean'" + }, + { + "path": "$[0].gather_facts", + "message": "'non' does not match '^\\\\{[\\\\{%](.|[\\r\\n])*[\\\\}%]\\\\}$'" } ] } diff --git a/test/schemas/negative_test/playbooks/gather_subset.yml.md b/test/schemas/negative_test/playbooks/gather_subset.yml.md index b426a23..5ee372b 100644 --- a/test/schemas/negative_test/playbooks/gather_subset.yml.md +++ b/test/schemas/negative_test/playbooks/gather_subset.yml.md @@ -84,6 +84,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/gather_subset.yml", @@ -94,6 +95,11 @@ stdout: "path": "$[0]", "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].gather_subset", + "message": "'all' is not of type 'array'" + }, + "num_sub_errors": 4, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/gather_subset2.yml.md b/test/schemas/negative_test/playbooks/gather_subset2.yml.md index 8d6be68..d5ec667 100644 --- a/test/schemas/negative_test/playbooks/gather_subset2.yml.md +++ b/test/schemas/negative_test/playbooks/gather_subset2.yml.md @@ -230,6 +230,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/gather_subset2.yml", @@ -240,6 +241,11 @@ stdout: "path": "$[0]", "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].gather_subset[0]", + "message": "'invalid' is not one of ['all', 'min', 'all_ipv4_addresses', 'all_ipv6_addresses', 'apparmor', 'architecture', 'caps', 'chroot,cmdline', 'date_time', 'default_ipv4', 'default_ipv6', 'devices', 'distribution', 'distribution_major_version', 'distribution_release', 'distribution_version', 'dns', 'effective_group_ids', 'effective_user_id', 'env', 'facter', 'fips', 'hardware', 'interfaces', 'is_chroot', 'iscsi', 'kernel', 'local', 'lsb', 'machine', 'machine_id', 'mounts', 'network', 'ohai', 'os_family', 'pkg_mgr', 'platform', 'processor', 'processor_cores', 'processor_count', 'python', 'python_version', 'real_user_id', 'selinux', 'service_mgr', 'ssh_host_key_dsa_public', 'ssh_host_key_ecdsa_public', 'ssh_host_key_ed25519_public', 'ssh_host_key_rsa_public', 'ssh_host_pub_keys', 'ssh_pub_keys', 'system', 'system_capabilities', 'system_capabilities_enforced', 'user', 'user_dir', 'user_gecos', 'user_gid', 'user_id', 'user_shell', 'user_uid', 'virtual', 'virtualization_role', 'virtualization_type']" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/gather_subset3.yml.md b/test/schemas/negative_test/playbooks/gather_subset3.yml.md index 7dc1b13..c2ed681 100644 --- a/test/schemas/negative_test/playbooks/gather_subset3.yml.md +++ b/test/schemas/negative_test/playbooks/gather_subset3.yml.md @@ -248,6 +248,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/gather_subset3.yml", @@ -258,6 +259,11 @@ stdout: "path": "$[0]", "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].gather_subset[0]", + "message": "1 is not one of ['all', 'min', 'all_ipv4_addresses', 'all_ipv6_addresses', 'apparmor', 'architecture', 'caps', 'chroot,cmdline', 'date_time', 'default_ipv4', 'default_ipv6', 'devices', 'distribution', 'distribution_major_version', 'distribution_release', 'distribution_version', 'dns', 'effective_group_ids', 'effective_user_id', 'env', 'facter', 'fips', 'hardware', 'interfaces', 'is_chroot', 'iscsi', 'kernel', 'local', 'lsb', 'machine', 'machine_id', 'mounts', 'network', 'ohai', 'os_family', 'pkg_mgr', 'platform', 'processor', 'processor_cores', 'processor_count', 'python', 'python_version', 'real_user_id', 'selinux', 'service_mgr', 'ssh_host_key_dsa_public', 'ssh_host_key_ecdsa_public', 'ssh_host_key_ed25519_public', 'ssh_host_key_rsa_public', 'ssh_host_pub_keys', 'ssh_pub_keys', 'system', 'system_capabilities', 'system_capabilities_enforced', 'user', 'user_dir', 'user_gecos', 'user_gid', 'user_id', 'user_shell', 'user_uid', 'virtual', 'virtualization_role', 'virtualization_type']" + }, + "num_sub_errors": 8, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/gather_subset4.yml.md b/test/schemas/negative_test/playbooks/gather_subset4.yml.md index ada01cb..6372c84 100644 --- a/test/schemas/negative_test/playbooks/gather_subset4.yml.md +++ b/test/schemas/negative_test/playbooks/gather_subset4.yml.md @@ -84,6 +84,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/gather_subset4.yml", @@ -94,6 +95,11 @@ stdout: "path": "$[0]", "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].gather_subset", + "message": "1 is not of type 'array'" + }, + "num_sub_errors": 4, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/ignore-unreachable.yml b/test/schemas/negative_test/playbooks/ignore-unreachable.yml new file mode 100644 index 0000000..0934936 --- /dev/null +++ b/test/schemas/negative_test/playbooks/ignore-unreachable.yml @@ -0,0 +1,13 @@ +--- +- name: Test + hosts: localhost + tasks: + - name: Debug + ansible.builtin.debug: + msg: ignore_unreachable should not be a string + ignore_unreachable: "yes" + + - name: Debug + ansible.builtin.debug: + msg: jinja evaluation should not be a string + ignore_unreachable: 123 diff --git a/test/schemas/negative_test/playbooks/ignore-unreachable.yml.md b/test/schemas/negative_test/playbooks/ignore-unreachable.yml.md new file mode 100644 index 0000000..b12403d --- /dev/null +++ b/test/schemas/negative_test/playbooks/ignore-unreachable.yml.md @@ -0,0 +1,329 @@ +# ajv errors + +```json +[ + { + "instancePath": "/0", + "keyword": "required", + "message": "must have required property 'ansible.builtin.import_playbook'", + "params": { + "missingProperty": "ansible.builtin.import_playbook" + }, + "schemaPath": "#/oneOf/0/required" + }, + { + "instancePath": "/0", + "keyword": "required", + "message": "must have required property 'import_playbook'", + "params": { + "missingProperty": "import_playbook" + }, + "schemaPath": "#/oneOf/1/required" + }, + { + "instancePath": "/0", + "keyword": "oneOf", + "message": "must match exactly one schema in oneOf", + "params": { + "passingSchemas": null + }, + "schemaPath": "#/oneOf" + }, + { + "instancePath": "/0", + "keyword": "additionalProperties", + "message": "must NOT have additional properties", + "params": { + "additionalProperty": "hosts" + }, + "schemaPath": "#/additionalProperties" + }, + { + "instancePath": "/0", + "keyword": "additionalProperties", + "message": "must NOT have additional properties", + "params": { + "additionalProperty": "tasks" + }, + "schemaPath": "#/additionalProperties" + }, + { + "instancePath": "/0/tasks/0", + "keyword": "required", + "message": "must have required property 'block'", + "params": { + "missingProperty": "block" + }, + "schemaPath": "#/required" + }, + { + "instancePath": "/0/tasks/0/ignore_unreachable", + "keyword": "type", + "message": "must be boolean", + "params": { + "type": "boolean" + }, + "schemaPath": "#/oneOf/0/type" + }, + { + "instancePath": "/0/tasks/0/ignore_unreachable", + "keyword": "pattern", + "message": "must match pattern \"^\\{[\\{%](.|[\r\n])*[\\}%]\\}$\"", + "params": { + "pattern": "^\\{[\\{%](.|[\r\n])*[\\}%]\\}$" + }, + "schemaPath": "#/$defs/full-jinja/pattern" + }, + { + "instancePath": "/0/tasks/0/ignore_unreachable", + "keyword": "oneOf", + "message": "must match exactly one schema in oneOf", + "params": { + "passingSchemas": null + }, + "schemaPath": "#/oneOf" + }, + { + "instancePath": "/0/tasks/0/ignore_unreachable", + "keyword": "type", + "message": "must be boolean", + "params": { + "type": "boolean" + }, + "schemaPath": "#/oneOf/0/type" + }, + { + "instancePath": "/0/tasks/0/ignore_unreachable", + "keyword": "pattern", + "message": "must match pattern \"^\\{[\\{%](.|[\r\n])*[\\}%]\\}$\"", + "params": { + "pattern": "^\\{[\\{%](.|[\r\n])*[\\}%]\\}$" + }, + "schemaPath": "#/$defs/full-jinja/pattern" + }, + { + "instancePath": "/0/tasks/0/ignore_unreachable", + "keyword": "oneOf", + "message": "must match exactly one schema in oneOf", + "params": { + "passingSchemas": null + }, + "schemaPath": "#/oneOf" + }, + { + "instancePath": "/0/tasks/0", + "keyword": "anyOf", + "message": "must match a schema in anyOf", + "params": {}, + "schemaPath": "#/items/anyOf" + }, + { + "instancePath": "/0/tasks/1", + "keyword": "required", + "message": "must have required property 'block'", + "params": { + "missingProperty": "block" + }, + "schemaPath": "#/required" + }, + { + "instancePath": "/0/tasks/1/ignore_unreachable", + "keyword": "type", + "message": "must be boolean", + "params": { + "type": "boolean" + }, + "schemaPath": "#/oneOf/0/type" + }, + { + "instancePath": "/0/tasks/1/ignore_unreachable", + "keyword": "type", + "message": "must be string", + "params": { + "type": "string" + }, + "schemaPath": "#/oneOf/1/type" + }, + { + "instancePath": "/0/tasks/1/ignore_unreachable", + "keyword": "type", + "message": "must be string", + "params": { + "type": "string" + }, + "schemaPath": "#/$defs/full-jinja/type" + }, + { + "instancePath": "/0/tasks/1/ignore_unreachable", + "keyword": "oneOf", + "message": "must match exactly one schema in oneOf", + "params": { + "passingSchemas": null + }, + "schemaPath": "#/oneOf" + }, + { + "instancePath": "/0/tasks/1/ignore_unreachable", + "keyword": "type", + "message": "must be boolean", + "params": { + "type": "boolean" + }, + "schemaPath": "#/oneOf/0/type" + }, + { + "instancePath": "/0/tasks/1/ignore_unreachable", + "keyword": "type", + "message": "must be string", + "params": { + "type": "string" + }, + "schemaPath": "#/oneOf/1/type" + }, + { + "instancePath": "/0/tasks/1/ignore_unreachable", + "keyword": "type", + "message": "must be string", + "params": { + "type": "string" + }, + "schemaPath": "#/$defs/full-jinja/type" + }, + { + "instancePath": "/0/tasks/1/ignore_unreachable", + "keyword": "oneOf", + "message": "must match exactly one schema in oneOf", + "params": { + "passingSchemas": null + }, + "schemaPath": "#/oneOf" + }, + { + "instancePath": "/0/tasks/1", + "keyword": "anyOf", + "message": "must match a schema in anyOf", + "params": {}, + "schemaPath": "#/items/anyOf" + }, + { + "instancePath": "/0", + "keyword": "oneOf", + "message": "must match exactly one schema in oneOf", + "params": { + "passingSchemas": null + }, + "schemaPath": "#/items/oneOf" + } +] +``` + +# check-jsonschema + +stdout: + +```json +{ + "status": "fail", + "successes": [], + "errors": [ + { + "filename": "negative_test/playbooks/ignore-unreachable.yml", + "path": "$[0]", + "message": "{'name': 'Test', 'hosts': 'localhost', 'tasks': [{'name': 'Debug', 'ansible.builtin.debug': {'msg': 'ignore_unreachable should not be a string'}, 'ignore_unreachable': 'yes'}, {'name': 'Debug', 'ansible.builtin.debug': {'msg': 'jinja evaluation should not be a string'}, 'ignore_unreachable': 123}]} is not valid under any of the given schemas", + "has_sub_errors": true, + "best_match": { + "path": "$[0]", + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" + }, + "best_deep_match": { + "path": "$[0].tasks[0].ignore_unreachable", + "message": "'yes' is not of type 'boolean'" + }, + "num_sub_errors": 19, + "sub_errors": [ + { + "path": "$[0]", + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" + }, + { + "path": "$[0]", + "message": "{'name': 'Test', 'hosts': 'localhost', 'tasks': [{'name': 'Debug', 'ansible.builtin.debug': {'msg': 'ignore_unreachable should not be a string'}, 'ignore_unreachable': 'yes'}, {'name': 'Debug', 'ansible.builtin.debug': {'msg': 'jinja evaluation should not be a string'}, 'ignore_unreachable': 123}]} is not valid under any of the given schemas" + }, + { + "path": "$[0]", + "message": "'ansible.builtin.import_playbook' is a required property" + }, + { + "path": "$[0]", + "message": "'import_playbook' is a required property" + }, + { + "path": "$[0].tasks[0]", + "message": "{'name': 'Debug', 'ansible.builtin.debug': {'msg': 'ignore_unreachable should not be a string'}, 'ignore_unreachable': 'yes'} is not valid under any of the given schemas" + }, + { + "path": "$[0].tasks[0].ignore_unreachable", + "message": "'yes' is not valid under any of the given schemas" + }, + { + "path": "$[0].tasks[0].ignore_unreachable", + "message": "'yes' is not of type 'boolean'" + }, + { + "path": "$[0].tasks[0].ignore_unreachable", + "message": "'yes' does not match '^\\\\{[\\\\{%](.|[\\r\\n])*[\\\\}%]\\\\}$'" + }, + { + "path": "$[0].tasks[0]", + "message": "'block' is a required property" + }, + { + "path": "$[0].tasks[0].ignore_unreachable", + "message": "'yes' is not valid under any of the given schemas" + }, + { + "path": "$[0].tasks[0].ignore_unreachable", + "message": "'yes' is not of type 'boolean'" + }, + { + "path": "$[0].tasks[0].ignore_unreachable", + "message": "'yes' does not match '^\\\\{[\\\\{%](.|[\\r\\n])*[\\\\}%]\\\\}$'" + }, + { + "path": "$[0].tasks[1]", + "message": "{'name': 'Debug', 'ansible.builtin.debug': {'msg': 'jinja evaluation should not be a string'}, 'ignore_unreachable': 123} is not valid under any of the given schemas" + }, + { + "path": "$[0].tasks[1].ignore_unreachable", + "message": "123 is not valid under any of the given schemas" + }, + { + "path": "$[0].tasks[1].ignore_unreachable", + "message": "123 is not of type 'boolean'" + }, + { + "path": "$[0].tasks[1].ignore_unreachable", + "message": "123 is not of type 'string'" + }, + { + "path": "$[0].tasks[1]", + "message": "'block' is a required property" + }, + { + "path": "$[0].tasks[1].ignore_unreachable", + "message": "123 is not valid under any of the given schemas" + }, + { + "path": "$[0].tasks[1].ignore_unreachable", + "message": "123 is not of type 'boolean'" + }, + { + "path": "$[0].tasks[1].ignore_unreachable", + "message": "123 is not of type 'string'" + } + ] + } + ], + "parse_errors": [] +} +``` diff --git a/test/schemas/negative_test/playbooks/ignore_errors.yml.md b/test/schemas/negative_test/playbooks/ignore_errors.yml.md index 61c3116..c76c098 100644 --- a/test/schemas/negative_test/playbooks/ignore_errors.yml.md +++ b/test/schemas/negative_test/playbooks/ignore_errors.yml.md @@ -136,6 +136,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/ignore_errors.yml", @@ -146,6 +147,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tasks[0].ignore_errors", + "message": "'should_ignore_errors' is not of type 'boolean'" + }, + "num_sub_errors": 11, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/import_playbook.yml.md b/test/schemas/negative_test/playbooks/import_playbook.yml.md index def3dce..a04a1b8 100644 --- a/test/schemas/negative_test/playbooks/import_playbook.yml.md +++ b/test/schemas/negative_test/playbooks/import_playbook.yml.md @@ -55,6 +55,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/import_playbook.yml", @@ -65,6 +66,11 @@ stdout: "path": "$[0]", "message": "{'ansible.builtin.import_playbook': {}} should not be valid under {'required': ['ansible.builtin.import_playbook']}" }, + "best_deep_match": { + "path": "$[0].ansible.builtin.import_playbook", + "message": "{} is not of type 'string'" + }, + "num_sub_errors": 3, "sub_errors": [ { "path": "$[0].ansible.builtin.import_playbook", diff --git a/test/schemas/negative_test/playbooks/import_playbook_exclusive.yml.md b/test/schemas/negative_test/playbooks/import_playbook_exclusive.yml.md index 184a434..143165f 100644 --- a/test/schemas/negative_test/playbooks/import_playbook_exclusive.yml.md +++ b/test/schemas/negative_test/playbooks/import_playbook_exclusive.yml.md @@ -85,6 +85,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/import_playbook_exclusive.yml", @@ -95,6 +96,11 @@ stdout: "path": "$[0]", "message": "{'ansible.builtin.import_playbook': 'foo.yml', 'import_playbook': 'other.yml'} should not be valid under {'required': ['ansible.builtin.import_playbook']}" }, + "best_deep_match": { + "path": "$[0]", + "message": "{'ansible.builtin.import_playbook': 'foo.yml', 'import_playbook': 'other.yml'} should not be valid under {'required': ['import_playbook']}" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/include.yml b/test/schemas/negative_test/playbooks/include.yml new file mode 100644 index 0000000..5504e13 --- /dev/null +++ b/test/schemas/negative_test/playbooks/include.yml @@ -0,0 +1,3 @@ +- hosts: localhost + tasks: + - include: foo.yml # <-- removed in Ansible 2.16 diff --git a/test/schemas/negative_test/playbooks/include.yml.md b/test/schemas/negative_test/playbooks/include.yml.md new file mode 100644 index 0000000..c577d84 --- /dev/null +++ b/test/schemas/negative_test/playbooks/include.yml.md @@ -0,0 +1,142 @@ +# ajv errors + +```json +[ + { + "instancePath": "/0", + "keyword": "required", + "message": "must have required property 'ansible.builtin.import_playbook'", + "params": { + "missingProperty": "ansible.builtin.import_playbook" + }, + "schemaPath": "#/oneOf/0/required" + }, + { + "instancePath": "/0", + "keyword": "required", + "message": "must have required property 'import_playbook'", + "params": { + "missingProperty": "import_playbook" + }, + "schemaPath": "#/oneOf/1/required" + }, + { + "instancePath": "/0", + "keyword": "oneOf", + "message": "must match exactly one schema in oneOf", + "params": { + "passingSchemas": null + }, + "schemaPath": "#/oneOf" + }, + { + "instancePath": "/0", + "keyword": "additionalProperties", + "message": "must NOT have additional properties", + "params": { + "additionalProperty": "hosts" + }, + "schemaPath": "#/additionalProperties" + }, + { + "instancePath": "/0", + "keyword": "additionalProperties", + "message": "must NOT have additional properties", + "params": { + "additionalProperty": "tasks" + }, + "schemaPath": "#/additionalProperties" + }, + { + "instancePath": "/0/tasks/0", + "keyword": "required", + "message": "must have required property 'block'", + "params": { + "missingProperty": "block" + }, + "schemaPath": "#/required" + }, + { + "instancePath": "/0/tasks/0/include", + "keyword": "not", + "message": "must NOT be valid", + "params": {}, + "schemaPath": "#/$defs/removed-include-module/not" + }, + { + "instancePath": "/0/tasks/0", + "keyword": "anyOf", + "message": "must match a schema in anyOf", + "params": {}, + "schemaPath": "#/items/anyOf" + }, + { + "instancePath": "/0", + "keyword": "oneOf", + "message": "must match exactly one schema in oneOf", + "params": { + "passingSchemas": null + }, + "schemaPath": "#/items/oneOf" + } +] +``` + +# check-jsonschema + +stdout: + +```json +{ + "status": "fail", + "successes": [], + "errors": [ + { + "filename": "negative_test/playbooks/include.yml", + "path": "$[0]", + "message": "{'hosts': 'localhost', 'tasks': [{'include': 'foo.yml'}]} is not valid under any of the given schemas", + "has_sub_errors": true, + "best_match": { + "path": "$[0]", + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" + }, + "best_deep_match": { + "path": "$[0].tasks[0].include", + "message": "'foo.yml' should not be valid under {}" + }, + "num_sub_errors": 6, + "sub_errors": [ + { + "path": "$[0]", + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" + }, + { + "path": "$[0]", + "message": "{'hosts': 'localhost', 'tasks': [{'include': 'foo.yml'}]} is not valid under any of the given schemas" + }, + { + "path": "$[0]", + "message": "'ansible.builtin.import_playbook' is a required property" + }, + { + "path": "$[0]", + "message": "'import_playbook' is a required property" + }, + { + "path": "$[0].tasks[0]", + "message": "{'include': 'foo.yml'} is not valid under any of the given schemas" + }, + { + "path": "$[0].tasks[0]", + "message": "'block' is a required property" + }, + { + "path": "$[0].tasks[0].include", + "message": "'foo.yml' should not be valid under {}" + } + ] + } + ], + "parse_errors": [] +} +``` diff --git a/test/schemas/negative_test/playbooks/invalid-failed-when.yml.md b/test/schemas/negative_test/playbooks/invalid-failed-when.yml.md index 3a41059..e2d1a0d 100644 --- a/test/schemas/negative_test/playbooks/invalid-failed-when.yml.md +++ b/test/schemas/negative_test/playbooks/invalid-failed-when.yml.md @@ -170,6 +170,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/invalid-failed-when.yml", @@ -180,6 +181,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tasks[0].failed_when", + "message": "123 is not of type 'boolean'" + }, + "num_sub_errors": 15, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/invalid-serial.yml.md b/test/schemas/negative_test/playbooks/invalid-serial.yml.md index 5c48b21..80785f0 100644 --- a/test/schemas/negative_test/playbooks/invalid-serial.yml.md +++ b/test/schemas/negative_test/playbooks/invalid-serial.yml.md @@ -118,6 +118,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/invalid-serial.yml", @@ -128,6 +129,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'serial' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].serial", + "message": "'10%BAD' is not of type 'integer'" + }, + "num_sub_errors": 9, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/invalid.yml.md b/test/schemas/negative_test/playbooks/invalid.yml.md index c3435dd..6a48a92 100644 --- a/test/schemas/negative_test/playbooks/invalid.yml.md +++ b/test/schemas/negative_test/playbooks/invalid.yml.md @@ -46,6 +46,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/invalid.yml", @@ -56,6 +57,11 @@ stdout: "path": "$[0]", "message": "{'name': 'foo', 'hosts': 'localhost', 'import_playbook': 'included.yml'} should not be valid under {'required': ['import_playbook']}" }, + "best_deep_match": { + "path": "$[0]", + "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" + }, + "num_sub_errors": 2, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/invalid_become.yml.md b/test/schemas/negative_test/playbooks/invalid_become.yml.md index 37d730d..e4fd6d5 100644 --- a/test/schemas/negative_test/playbooks/invalid_become.yml.md +++ b/test/schemas/negative_test/playbooks/invalid_become.yml.md @@ -93,6 +93,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/invalid_become.yml", @@ -103,6 +104,11 @@ stdout: "path": "$[0]", "message": "'become', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].become", + "message": "'yes' is not of type 'boolean'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/local_action.yml.md b/test/schemas/negative_test/playbooks/local_action.yml.md index 17f6244..d41de95 100644 --- a/test/schemas/negative_test/playbooks/local_action.yml.md +++ b/test/schemas/negative_test/playbooks/local_action.yml.md @@ -94,6 +94,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/local_action.yml", @@ -104,6 +105,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tasks[0].local_action", + "message": "[] is not of type 'string', 'object'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/loop.yml.md b/test/schemas/negative_test/playbooks/loop.yml.md index 88df838..c7b3e45 100644 --- a/test/schemas/negative_test/playbooks/loop.yml.md +++ b/test/schemas/negative_test/playbooks/loop.yml.md @@ -94,6 +94,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/loop.yml", @@ -104,6 +105,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tasks[0].loop", + "message": "123 is not of type 'string', 'array'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/loop2.yml.md b/test/schemas/negative_test/playbooks/loop2.yml.md index df60a41..cf77f85 100644 --- a/test/schemas/negative_test/playbooks/loop2.yml.md +++ b/test/schemas/negative_test/playbooks/loop2.yml.md @@ -94,6 +94,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/loop2.yml", @@ -104,6 +105,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tasks[0].loop", + "message": "{} is not of type 'string', 'array'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/no_log_partial_template.yml.md b/test/schemas/negative_test/playbooks/no_log_partial_template.yml.md index ee73686..c7fd4fd 100644 --- a/test/schemas/negative_test/playbooks/no_log_partial_template.yml.md +++ b/test/schemas/negative_test/playbooks/no_log_partial_template.yml.md @@ -136,6 +136,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/no_log_partial_template.yml", @@ -146,6 +147,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tasks[0].no_log", + "message": "'foo-{{ some_var }}' is not of type 'boolean'" + }, + "num_sub_errors": 11, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/no_log_string.yml.md b/test/schemas/negative_test/playbooks/no_log_string.yml.md index c8213c0..98b4bc2 100644 --- a/test/schemas/negative_test/playbooks/no_log_string.yml.md +++ b/test/schemas/negative_test/playbooks/no_log_string.yml.md @@ -136,6 +136,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/no_log_string.yml", @@ -146,6 +147,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tasks[0].no_log", + "message": "'some_var' is not of type 'boolean'" + }, + "num_sub_errors": 11, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/roles.yml.md b/test/schemas/negative_test/playbooks/roles.yml.md index 9b4e25a..72d7b85 100644 --- a/test/schemas/negative_test/playbooks/roles.yml.md +++ b/test/schemas/negative_test/playbooks/roles.yml.md @@ -75,6 +75,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/roles.yml", @@ -85,6 +86,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'roles' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].roles", + "message": "'xxx' is not of type 'array'" + }, + "num_sub_errors": 4, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/run_once_list.yml.md b/test/schemas/negative_test/playbooks/run_once_list.yml.md index 84b7dc1..63424ff 100644 --- a/test/schemas/negative_test/playbooks/run_once_list.yml.md +++ b/test/schemas/negative_test/playbooks/run_once_list.yml.md @@ -154,6 +154,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/run_once_list.yml", @@ -164,6 +165,11 @@ stdout: "path": "$[0]", "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tasks[0].run_once", + "message": "['{{ true }}', 'xxx'] is not of type 'boolean'" + }, + "num_sub_errors": 11, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/tags-mapping.yml.md b/test/schemas/negative_test/playbooks/tags-mapping.yml.md index aada0c6..10cdb9b 100644 --- a/test/schemas/negative_test/playbooks/tags-mapping.yml.md +++ b/test/schemas/negative_test/playbooks/tags-mapping.yml.md @@ -107,6 +107,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tags-mapping.yml", @@ -117,6 +118,11 @@ stdout: "path": "$[0]", "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tags", + "message": "{} is not of type 'string'" + }, + "num_sub_errors": 9, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/tags-number.yml.md b/test/schemas/negative_test/playbooks/tags-number.yml.md index 3d32737..48a264a 100644 --- a/test/schemas/negative_test/playbooks/tags-number.yml.md +++ b/test/schemas/negative_test/playbooks/tags-number.yml.md @@ -107,6 +107,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tags-number.yml", @@ -117,6 +118,11 @@ stdout: "path": "$[0]", "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tags", + "message": "123 is not of type 'string'" + }, + "num_sub_errors": 9, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/tasks.yml.md b/test/schemas/negative_test/playbooks/tasks.yml.md index 309912b..08d7fe4 100644 --- a/test/schemas/negative_test/playbooks/tasks.yml.md +++ b/test/schemas/negative_test/playbooks/tasks.yml.md @@ -141,6 +141,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks.yml", @@ -151,6 +152,11 @@ stdout: "path": "$[0]", "message": "'handlers', 'hosts', 'post_tasks', 'pre_tasks', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].handlers", + "message": "1.0 is not of type 'array', 'null'" + }, + "num_sub_errors": 7, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/tasks/args_integer.yml.md b/test/schemas/negative_test/playbooks/tasks/args_integer.yml.md index 8820251..25000f8 100644 --- a/test/schemas/negative_test/playbooks/tasks/args_integer.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/args_integer.yml.md @@ -64,6 +64,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/args_integer.yml", @@ -74,6 +75,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].args", + "message": "123 is not of type 'object'" + }, + "num_sub_errors": 3, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/tasks/args_string.yml.md b/test/schemas/negative_test/playbooks/tasks/args_string.yml.md index 6359a14..b1bf502 100644 --- a/test/schemas/negative_test/playbooks/tasks/args_string.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/args_string.yml.md @@ -55,6 +55,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/args_string.yml", @@ -65,6 +66,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].args", + "message": "'{{ }}123' is not of type 'object'" + }, + "num_sub_errors": 3, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/tasks/become_method_invalid.yml.md b/test/schemas/negative_test/playbooks/tasks/become_method_invalid.yml.md index fc1e692..b94527a 100644 --- a/test/schemas/negative_test/playbooks/tasks/become_method_invalid.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/become_method_invalid.yml.md @@ -140,6 +140,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/become_method_invalid.yml", @@ -150,6 +151,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].become_method", + "message": "True is not one of ['ansible.builtin.sudo', 'ansible.builtin.su', 'community.general.pbrun', 'community.general.pfexec', 'ansible.builtin.runas', 'community.general.dzdo', 'community.general.ksu', 'community.general.doas', 'community.general.machinectl', 'community.general.pmrun', 'community.general.sesu', 'community.general.sudosu']" + }, + "num_sub_errors": 10, "sub_errors": [ { "path": "$[0].become_method", diff --git a/test/schemas/negative_test/playbooks/tasks/ignore_errors.yml.md b/test/schemas/negative_test/playbooks/tasks/ignore_errors.yml.md index 559a200..abd8968 100644 --- a/test/schemas/negative_test/playbooks/tasks/ignore_errors.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/ignore_errors.yml.md @@ -82,6 +82,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/ignore_errors.yml", @@ -92,6 +93,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].ignore_errors", + "message": "'should_ignore_errors' is not of type 'boolean'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0].ignore_errors", diff --git a/test/schemas/negative_test/playbooks/tasks/invalid_block.yml.md b/test/schemas/negative_test/playbooks/tasks/invalid_block.yml.md index bf4b30e..f952161 100644 --- a/test/schemas/negative_test/playbooks/tasks/invalid_block.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/invalid_block.yml.md @@ -35,6 +35,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/invalid_block.yml", @@ -45,6 +46,11 @@ stdout: "path": "$[0]", "message": "{'block': {}} should not be valid under {'required': ['block']}" }, + "best_deep_match": { + "path": "$[0].block", + "message": "{} is not of type 'array'" + }, + "num_sub_errors": 1, "sub_errors": [ { "path": "$[0].block", diff --git a/test/schemas/negative_test/playbooks/tasks/local_action.yml.md b/test/schemas/negative_test/playbooks/tasks/local_action.yml.md index cf67e7b..0b1151b 100644 --- a/test/schemas/negative_test/playbooks/tasks/local_action.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/local_action.yml.md @@ -40,6 +40,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/local_action.yml", @@ -50,6 +51,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].local_action", + "message": "[] is not of type 'string', 'object'" + }, + "num_sub_errors": 1, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/tasks/loop.yml.md b/test/schemas/negative_test/playbooks/tasks/loop.yml.md index de8277f..45a1908 100644 --- a/test/schemas/negative_test/playbooks/tasks/loop.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/loop.yml.md @@ -40,6 +40,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/loop.yml", @@ -50,6 +51,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].loop", + "message": "{} is not of type 'string', 'array'" + }, + "num_sub_errors": 1, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/tasks/loop2.yml.md b/test/schemas/negative_test/playbooks/tasks/loop2.yml.md index c36d7c9..e29af19 100644 --- a/test/schemas/negative_test/playbooks/tasks/loop2.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/loop2.yml.md @@ -40,6 +40,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/loop2.yml", @@ -50,6 +51,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].loop", + "message": "123 is not of type 'string', 'array'" + }, + "num_sub_errors": 1, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/tasks/no_log_number.yml.md b/test/schemas/negative_test/playbooks/tasks/no_log_number.yml.md index 4b9516c..bc85fd7 100644 --- a/test/schemas/negative_test/playbooks/tasks/no_log_number.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/no_log_number.yml.md @@ -100,6 +100,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/no_log_number.yml", @@ -110,6 +111,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].no_log", + "message": "123 is not of type 'boolean'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0].no_log", diff --git a/test/schemas/negative_test/playbooks/tasks/no_log_string.yml.md b/test/schemas/negative_test/playbooks/tasks/no_log_string.yml.md index 6742175..ec88c66 100644 --- a/test/schemas/negative_test/playbooks/tasks/no_log_string.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/no_log_string.yml.md @@ -82,6 +82,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/no_log_string.yml", @@ -92,6 +93,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].no_log", + "message": "'some_var' is not of type 'boolean'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0].no_log", diff --git a/test/schemas/negative_test/playbooks/tasks/tags-mapping.yml.md b/test/schemas/negative_test/playbooks/tasks/tags-mapping.yml.md index d860605..998d783 100644 --- a/test/schemas/negative_test/playbooks/tasks/tags-mapping.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/tags-mapping.yml.md @@ -78,6 +78,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/tags-mapping.yml", @@ -88,6 +89,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].tags", + "message": "{} is not of type 'string'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0].tags", diff --git a/test/schemas/negative_test/playbooks/tasks/tags-string.yml.md b/test/schemas/negative_test/playbooks/tasks/tags-string.yml.md index 0bb7ed0..cdf421d 100644 --- a/test/schemas/negative_test/playbooks/tasks/tags-string.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/tags-string.yml.md @@ -78,6 +78,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/tags-string.yml", @@ -88,6 +89,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].tags", + "message": "123 is not of type 'string'" + }, + "num_sub_errors": 6, "sub_errors": [ { "path": "$[0].tags", diff --git a/test/schemas/negative_test/playbooks/tasks/when_integer.yml.md b/test/schemas/negative_test/playbooks/tasks/when_integer.yml.md index bc59cc4..8acb890 100644 --- a/test/schemas/negative_test/playbooks/tasks/when_integer.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/when_integer.yml.md @@ -100,6 +100,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/when_integer.yml", @@ -110,6 +111,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].when", + "message": "123 is not of type 'boolean'" + }, + "num_sub_errors": 8, "sub_errors": [ { "path": "$[0].when", diff --git a/test/schemas/negative_test/playbooks/tasks/when_object.yml.md b/test/schemas/negative_test/playbooks/tasks/when_object.yml.md index 6c28d0c..4ea653b 100644 --- a/test/schemas/negative_test/playbooks/tasks/when_object.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/when_object.yml.md @@ -100,6 +100,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/when_object.yml", @@ -110,6 +111,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].when", + "message": "{} is not of type 'boolean'" + }, + "num_sub_errors": 8, "sub_errors": [ { "path": "$[0].when", diff --git a/test/schemas/negative_test/playbooks/tasks/with_items_boolean.yml.md b/test/schemas/negative_test/playbooks/tasks/with_items_boolean.yml.md index ffc8ef8..92340d2 100644 --- a/test/schemas/negative_test/playbooks/tasks/with_items_boolean.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/with_items_boolean.yml.md @@ -53,6 +53,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/with_items_boolean.yml", @@ -63,6 +64,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].with_items", + "message": "True is not of type 'string'" + }, + "num_sub_errors": 3, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/tasks/with_items_untemplated_string.yml.md b/test/schemas/negative_test/playbooks/tasks/with_items_untemplated_string.yml.md index 158b0ee..8ecd7bf 100644 --- a/test/schemas/negative_test/playbooks/tasks/with_items_untemplated_string.yml.md +++ b/test/schemas/negative_test/playbooks/tasks/with_items_untemplated_string.yml.md @@ -53,6 +53,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/tasks/with_items_untemplated_string.yml", @@ -63,6 +64,11 @@ stdout: "path": "$[0]", "message": "'block' is a required property" }, + "best_deep_match": { + "path": "$[0].with_items", + "message": "'foobar' does not match '^\\\\{[\\\\{%](.|[\\r\\n])*[\\\\}%]\\\\}$'" + }, + "num_sub_errors": 3, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/var_files_list_number.yml.md b/test/schemas/negative_test/playbooks/var_files_list_number.yml.md index e915593..c47cc1b 100644 --- a/test/schemas/negative_test/playbooks/var_files_list_number.yml.md +++ b/test/schemas/negative_test/playbooks/var_files_list_number.yml.md @@ -93,6 +93,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/var_files_list_number.yml", @@ -103,6 +104,11 @@ stdout: "path": "$[0]", "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].vars_files[0]", + "message": "0 is not of type 'string'" + }, + "num_sub_errors": 7, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/var_files_list_of_list_number.yml.md b/test/schemas/negative_test/playbooks/var_files_list_of_list_number.yml.md index 3494498..2f9b9cb 100644 --- a/test/schemas/negative_test/playbooks/var_files_list_of_list_number.yml.md +++ b/test/schemas/negative_test/playbooks/var_files_list_of_list_number.yml.md @@ -102,6 +102,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/var_files_list_of_list_number.yml", @@ -112,6 +113,11 @@ stdout: "path": "$[0]", "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].vars_files[0][0]", + "message": "0 is not of type 'string'" + }, + "num_sub_errors": 8, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/var_files_number.yml.md b/test/schemas/negative_test/playbooks/var_files_number.yml.md index fa97e7e..f121b09 100644 --- a/test/schemas/negative_test/playbooks/var_files_number.yml.md +++ b/test/schemas/negative_test/playbooks/var_files_number.yml.md @@ -79,6 +79,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/var_files_number.yml", @@ -89,6 +90,11 @@ stdout: "path": "$[0]", "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].vars_files", + "message": "0 is not of type 'object'" + }, + "num_sub_errors": 5, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/vars/asterisk.yml.md b/test/schemas/negative_test/playbooks/vars/asterisk.yml.md index 1ea9a98..9204de1 100644 --- a/test/schemas/negative_test/playbooks/vars/asterisk.yml.md +++ b/test/schemas/negative_test/playbooks/vars/asterisk.yml.md @@ -46,6 +46,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/vars/asterisk.yml", @@ -56,6 +57,11 @@ stdout: "path": "$", "message": "{'*foo': '...'} is not of type 'string'" }, + "best_deep_match": { + "path": "$", + "message": "'*foo' does not match any of the regexes: '^(?!(False|None|True|and|any_errors_fatal|as|assert|async|await|become|become_exe|become_flags|become_method|become_user|break|check_mode|class|collections|connection|continue|debugger|def|del|diff|elif|else|environment|except|fact_path|finally|for|force_handlers|from|gather_facts|gather_subset|gather_timeout|global|handlers|hosts|if|ignore_errors|ignore_unreachable|import|in|is|lambda|max_fail_percentage|module_defaults|name|no_log|nonlocal|not|or|order|pass|port|post_tasks|pre_tasks|raise|remote_user|return|roles|run_once|serial|strategy|tags|tasks|throttle|timeout|try|vars|vars_files|vars_prompt|while|with|yield)$)[a-zA-Z_][\\\\w]*$'" + }, + "num_sub_errors": 2, "sub_errors": [ { "path": "$", diff --git a/test/schemas/negative_test/playbooks/vars/dash-in-var-name.yml.md b/test/schemas/negative_test/playbooks/vars/dash-in-var-name.yml.md index b862e69..6e0a83b 100644 --- a/test/schemas/negative_test/playbooks/vars/dash-in-var-name.yml.md +++ b/test/schemas/negative_test/playbooks/vars/dash-in-var-name.yml.md @@ -46,6 +46,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/vars/dash-in-var-name.yml", @@ -56,6 +57,11 @@ stdout: "path": "$", "message": "{'foo-bar': '...'} is not of type 'string'" }, + "best_deep_match": { + "path": "$", + "message": "'foo-bar' does not match any of the regexes: '^(?!(False|None|True|and|any_errors_fatal|as|assert|async|await|become|become_exe|become_flags|become_method|become_user|break|check_mode|class|collections|connection|continue|debugger|def|del|diff|elif|else|environment|except|fact_path|finally|for|force_handlers|from|gather_facts|gather_subset|gather_timeout|global|handlers|hosts|if|ignore_errors|ignore_unreachable|import|in|is|lambda|max_fail_percentage|module_defaults|name|no_log|nonlocal|not|or|order|pass|port|post_tasks|pre_tasks|raise|remote_user|return|roles|run_once|serial|strategy|tags|tasks|throttle|timeout|try|vars|vars_files|vars_prompt|while|with|yield)$)[a-zA-Z_][\\\\w]*$'" + }, + "num_sub_errors": 2, "sub_errors": [ { "path": "$", diff --git a/test/schemas/negative_test/playbooks/vars/list.yml.md b/test/schemas/negative_test/playbooks/vars/list.yml.md index e2c9bf5..82f599a 100644 --- a/test/schemas/negative_test/playbooks/vars/list.yml.md +++ b/test/schemas/negative_test/playbooks/vars/list.yml.md @@ -46,6 +46,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/vars/list.yml", @@ -56,6 +57,11 @@ stdout: "path": "$", "message": "['foo', 'bar'] is not of type 'object'" }, + "best_deep_match": { + "path": "$", + "message": "['foo', 'bar'] is not of type 'object'" + }, + "num_sub_errors": 2, "sub_errors": [ { "path": "$", diff --git a/test/schemas/negative_test/playbooks/vars/numeric-var-name.yml.md b/test/schemas/negative_test/playbooks/vars/numeric-var-name.yml.md index 7ddcff6..9f15015 100644 --- a/test/schemas/negative_test/playbooks/vars/numeric-var-name.yml.md +++ b/test/schemas/negative_test/playbooks/vars/numeric-var-name.yml.md @@ -46,6 +46,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/vars/numeric-var-name.yml", @@ -56,6 +57,11 @@ stdout: "path": "$", "message": "{'12': '...'} is not of type 'string'" }, + "best_deep_match": { + "path": "$", + "message": "'12' does not match any of the regexes: '^(?!(False|None|True|and|any_errors_fatal|as|assert|async|await|become|become_exe|become_flags|become_method|become_user|break|check_mode|class|collections|connection|continue|debugger|def|del|diff|elif|else|environment|except|fact_path|finally|for|force_handlers|from|gather_facts|gather_subset|gather_timeout|global|handlers|hosts|if|ignore_errors|ignore_unreachable|import|in|is|lambda|max_fail_percentage|module_defaults|name|no_log|nonlocal|not|or|order|pass|port|post_tasks|pre_tasks|raise|remote_user|return|roles|run_once|serial|strategy|tags|tasks|throttle|timeout|try|vars|vars_files|vars_prompt|while|with|yield)$)[a-zA-Z_][\\\\w]*$'" + }, + "num_sub_errors": 2, "sub_errors": [ { "path": "$", diff --git a/test/schemas/negative_test/playbooks/vars/play-keyword.yml.md b/test/schemas/negative_test/playbooks/vars/play-keyword.yml.md index 6b88b2a..d463c1c 100644 --- a/test/schemas/negative_test/playbooks/vars/play-keyword.yml.md +++ b/test/schemas/negative_test/playbooks/vars/play-keyword.yml.md @@ -46,6 +46,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/vars/play-keyword.yml", @@ -56,6 +57,11 @@ stdout: "path": "$", "message": "{'environment': '...'} is not of type 'string'" }, + "best_deep_match": { + "path": "$", + "message": "'environment' does not match any of the regexes: '^(?!(False|None|True|and|any_errors_fatal|as|assert|async|await|become|become_exe|become_flags|become_method|become_user|break|check_mode|class|collections|connection|continue|debugger|def|del|diff|elif|else|environment|except|fact_path|finally|for|force_handlers|from|gather_facts|gather_subset|gather_timeout|global|handlers|hosts|if|ignore_errors|ignore_unreachable|import|in|is|lambda|max_fail_percentage|module_defaults|name|no_log|nonlocal|not|or|order|pass|port|post_tasks|pre_tasks|raise|remote_user|return|roles|run_once|serial|strategy|tags|tasks|throttle|timeout|try|vars|vars_files|vars_prompt|while|with|yield)$)[a-zA-Z_][\\\\w]*$'" + }, + "num_sub_errors": 2, "sub_errors": [ { "path": "$", diff --git a/test/schemas/negative_test/playbooks/vars/python-keyword.yml.md b/test/schemas/negative_test/playbooks/vars/python-keyword.yml.md index ca42f74..667364c 100644 --- a/test/schemas/negative_test/playbooks/vars/python-keyword.yml.md +++ b/test/schemas/negative_test/playbooks/vars/python-keyword.yml.md @@ -55,6 +55,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/vars/python-keyword.yml", @@ -65,6 +66,11 @@ stdout: "path": "$", "message": "{'async': '...', 'lambda': '...'} is not of type 'string'" }, + "best_deep_match": { + "path": "$", + "message": "'async', 'lambda' do not match any of the regexes: '^(?!(False|None|True|and|any_errors_fatal|as|assert|async|await|become|become_exe|become_flags|become_method|become_user|break|check_mode|class|collections|connection|continue|debugger|def|del|diff|elif|else|environment|except|fact_path|finally|for|force_handlers|from|gather_facts|gather_subset|gather_timeout|global|handlers|hosts|if|ignore_errors|ignore_unreachable|import|in|is|lambda|max_fail_percentage|module_defaults|name|no_log|nonlocal|not|or|order|pass|port|post_tasks|pre_tasks|raise|remote_user|return|roles|run_once|serial|strategy|tags|tasks|throttle|timeout|try|vars|vars_files|vars_prompt|while|with|yield)$)[a-zA-Z_][\\\\w]*$'" + }, + "num_sub_errors": 2, "sub_errors": [ { "path": "$", diff --git a/test/schemas/negative_test/playbooks/vars/varname-numeric-prefix.yml.md b/test/schemas/negative_test/playbooks/vars/varname-numeric-prefix.yml.md index 8b73b0a..620a03c 100644 --- a/test/schemas/negative_test/playbooks/vars/varname-numeric-prefix.yml.md +++ b/test/schemas/negative_test/playbooks/vars/varname-numeric-prefix.yml.md @@ -46,6 +46,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/vars/varname-numeric-prefix.yml", @@ -56,6 +57,11 @@ stdout: "path": "$", "message": "{'5foo': '...'} is not of type 'string'" }, + "best_deep_match": { + "path": "$", + "message": "'5foo' does not match any of the regexes: '^(?!(False|None|True|and|any_errors_fatal|as|assert|async|await|become|become_exe|become_flags|become_method|become_user|break|check_mode|class|collections|connection|continue|debugger|def|del|diff|elif|else|environment|except|fact_path|finally|for|force_handlers|from|gather_facts|gather_subset|gather_timeout|global|handlers|hosts|if|ignore_errors|ignore_unreachable|import|in|is|lambda|max_fail_percentage|module_defaults|name|no_log|nonlocal|not|or|order|pass|port|post_tasks|pre_tasks|raise|remote_user|return|roles|run_once|serial|strategy|tags|tasks|throttle|timeout|try|vars|vars_files|vars_prompt|while|with|yield)$)[a-zA-Z_][\\\\w]*$'" + }, + "num_sub_errors": 2, "sub_errors": [ { "path": "$", diff --git a/test/schemas/negative_test/playbooks/vas_prompt.yml.md b/test/schemas/negative_test/playbooks/vas_prompt.yml.md index d2d809d..ca1863f 100644 --- a/test/schemas/negative_test/playbooks/vas_prompt.yml.md +++ b/test/schemas/negative_test/playbooks/vas_prompt.yml.md @@ -75,6 +75,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/vas_prompt.yml", @@ -85,6 +86,11 @@ stdout: "path": "$[0]", "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].vars_prompt[0]", + "message": "Additional properties are not allowed ('tags' was unexpected)" + }, + "num_sub_errors": 5, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/playbooks/when.yml.md b/test/schemas/negative_test/playbooks/when.yml.md index 4c23dcb..125e9d6 100644 --- a/test/schemas/negative_test/playbooks/when.yml.md +++ b/test/schemas/negative_test/playbooks/when.yml.md @@ -195,6 +195,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/playbooks/when.yml", @@ -205,6 +206,11 @@ stdout: "path": "$[0]", "message": "'gather_facts', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, + "best_deep_match": { + "path": "$[0].tasks[0].when[1]", + "message": "123 is not of type 'boolean'" + }, + "num_sub_errors": 17, "sub_errors": [ { "path": "$[0]", diff --git a/test/schemas/negative_test/reqs3/meta/requirements.yml.md b/test/schemas/negative_test/reqs3/meta/requirements.yml.md index 5de6643..d0d7623 100644 --- a/test/schemas/negative_test/reqs3/meta/requirements.yml.md +++ b/test/schemas/negative_test/reqs3/meta/requirements.yml.md @@ -62,6 +62,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/reqs3/meta/requirements.yml", @@ -72,6 +73,11 @@ stdout: "path": "$", "message": "{'foo': 'bar'} is not of type 'array'" }, + "best_deep_match": { + "path": "$", + "message": "{'foo': 'bar'} is not of type 'array'" + }, + "num_sub_errors": 4, "sub_errors": [ { "path": "$", diff --git a/test/schemas/negative_test/roles/meta/argument_specs.yml.md b/test/schemas/negative_test/roles/meta/argument_specs.yml.md index 34da932..e06b00d 100644 --- a/test/schemas/negative_test/roles/meta/argument_specs.yml.md +++ b/test/schemas/negative_test/roles/meta/argument_specs.yml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/roles/meta/argument_specs.yml", diff --git a/test/schemas/negative_test/roles/meta/main.yml.md b/test/schemas/negative_test/roles/meta/main.yml.md index 2c9e99b..5ed52bf 100644 --- a/test/schemas/negative_test/roles/meta/main.yml.md +++ b/test/schemas/negative_test/roles/meta/main.yml.md @@ -39,6 +39,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/roles/meta/main.yml", diff --git a/test/schemas/negative_test/roles/meta_invalid_collection/meta/main.yml.md b/test/schemas/negative_test/roles/meta_invalid_collection/meta/main.yml.md index 1b8dcd0..bea80be 100644 --- a/test/schemas/negative_test/roles/meta_invalid_collection/meta/main.yml.md +++ b/test/schemas/negative_test/roles/meta_invalid_collection/meta/main.yml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/roles/meta_invalid_collection/meta/main.yml", diff --git a/test/schemas/negative_test/roles/meta_invalid_collections/meta/main.yml.md b/test/schemas/negative_test/roles/meta_invalid_collections/meta/main.yml.md index 5d775f0..722b549 100644 --- a/test/schemas/negative_test/roles/meta_invalid_collections/meta/main.yml.md +++ b/test/schemas/negative_test/roles/meta_invalid_collections/meta/main.yml.md @@ -21,6 +21,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/roles/meta_invalid_collections/meta/main.yml", diff --git a/test/schemas/negative_test/roles/meta_invalid_role_namespace/meta/main.yml.md b/test/schemas/negative_test/roles/meta_invalid_role_namespace/meta/main.yml.md index ad7e9d3..73369a2 100644 --- a/test/schemas/negative_test/roles/meta_invalid_role_namespace/meta/main.yml.md +++ b/test/schemas/negative_test/roles/meta_invalid_role_namespace/meta/main.yml.md @@ -19,15 +19,6 @@ "failingKeyword": "then" }, "schemaPath": "#/allOf/0/if" - }, - { - "instancePath": "/galaxy_info/namespace", - "keyword": "pattern", - "message": "must match pattern \"^[a-z][a-z0-9_]+$\"", - "params": { - "pattern": "^[a-z][a-z0-9_]+$" - }, - "schemaPath": "#/properties/namespace/pattern" } ] ``` @@ -39,18 +30,13 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/roles/meta_invalid_role_namespace/meta/main.yml", "path": "$.galaxy_info", "message": "'author' is a required property", "has_sub_errors": false - }, - { - "filename": "negative_test/roles/meta_invalid_role_namespace/meta/main.yml", - "path": "$.galaxy_info.namespace", - "message": "'foo-bar' does not match '^[a-z][a-z0-9_]+$'", - "has_sub_errors": false } ], "parse_errors": [] diff --git a/test/schemas/negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml b/test/schemas/negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml index 81d4d3d..0e94325 100644 --- a/test/schemas/negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml +++ b/test/schemas/negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml @@ -11,3 +11,4 @@ galaxy_info: dependencies: - version: foo # invalid, should have at least name, role or src properties + - 1234 # invalid, needs to be a string diff --git a/test/schemas/negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml.md b/test/schemas/negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml.md index f09b1ac..a518b18 100644 --- a/test/schemas/negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml.md +++ b/test/schemas/negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml.md @@ -4,6 +4,15 @@ [ { "instancePath": "/dependencies/0", + "keyword": "type", + "message": "must be string", + "params": { + "type": "string" + }, + "schemaPath": "#/properties/dependencies/items/anyOf/0/type" + }, + { + "instancePath": "/dependencies/0", "keyword": "required", "message": "must have required property 'role'", "params": { @@ -37,6 +46,38 @@ "schemaPath": "#/anyOf" }, { + "instancePath": "/dependencies/0", + "keyword": "anyOf", + "message": "must match a schema in anyOf", + "params": {}, + "schemaPath": "#/properties/dependencies/items/anyOf" + }, + { + "instancePath": "/dependencies/1", + "keyword": "type", + "message": "must be string", + "params": { + "type": "string" + }, + "schemaPath": "#/properties/dependencies/items/anyOf/0/type" + }, + { + "instancePath": "/dependencies/1", + "keyword": "type", + "message": "must be object", + "params": { + "type": "object" + }, + "schemaPath": "#/type" + }, + { + "instancePath": "/dependencies/1", + "keyword": "anyOf", + "message": "must match a schema in anyOf", + "params": {}, + "schemaPath": "#/properties/dependencies/items/anyOf" + }, + { "instancePath": "/galaxy_info", "keyword": "required", "message": "must have required property 'author'", @@ -64,6 +105,7 @@ stdout: ```json { "status": "fail", + "successes": [], "errors": [ { "filename": "negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml", @@ -72,11 +114,24 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$.dependencies[0]", - "message": "'role' is a required property" + "message": "{'version': 'foo'} is not of type 'string'" + }, + "best_deep_match": { + "path": "$.dependencies[0]", + "message": "{'version': 'foo'} is not of type 'string'" }, + "num_sub_errors": 4, "sub_errors": [ { "path": "$.dependencies[0]", + "message": "{'version': 'foo'} is not of type 'string'" + }, + { + "path": "$.dependencies[0]", + "message": "{'version': 'foo'} is not valid under any of the given schemas" + }, + { + "path": "$.dependencies[0]", "message": "'role' is a required property" }, { @@ -91,6 +146,31 @@ stdout: }, { "filename": "negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml", + "path": "$.dependencies[1]", + "message": "1234 is not valid under any of the given schemas", + "has_sub_errors": true, + "best_match": { + "path": "$.dependencies[1]", + "message": "1234 is not of type 'string'" + }, + "best_deep_match": { + "path": "$.dependencies[1]", + "message": "1234 is not of type 'string'" + }, + "num_sub_errors": 1, + "sub_errors": [ + { + "path": "$.dependencies[1]", + "message": "1234 is not of type 'string'" + }, + { + "path": "$.dependencies[1]", + "message": "1234 is not of type 'object'" + } + ] + }, + { + "filename": "negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml", "path": "$.galaxy_info", "message": "'author' is a required property", "has_sub_errors": false |