Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema fix #3671

Merged
merged 2 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/molecule/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Module containing molecule data files."""
19 changes: 13 additions & 6 deletions src/molecule/data/molecule.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@
"type": "object"
},
"MoleculeDependencyModel": {
"additionalProperties": false,
"unevaluatedProperties": false,
"properties": {
"command": {
"title": "Command",
"type": ["string", "null"]
},
"enabled": {
"default": true,
"title": "Enabled",
Expand All @@ -38,6 +34,17 @@
"type": "object"
}
},
"if": {
"properties": { "name": { "const": "galaxy" } }
},
"then": {
"properties": {
"command": { "title": "Command", "type": ["string", "null"] }
}
},
"else": {
"properties": { "command": { "title": "Command", "type": "string" } }
},
"required": ["name"],
"title": "MoleculeDependencyModel",
"type": "object"
Expand Down Expand Up @@ -509,7 +516,7 @@
"type": "object"
}
},
"$id": "https://raw.githubusercontent.com/ansible/schemas/main/f/molecule.json",
"$id": "https://raw.githubusercontent.com/ansible-community/molecule/main/src/molecule/data/molecule.json",
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
"examples": ["molecule/*/molecule.yml"],
Expand Down
4 changes: 2 additions & 2 deletions src/molecule/model/schema_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
from jsonschema import validate as jsonschema_validate
from jsonschema.exceptions import ValidationError

from molecule.schemas import __file__ as schemas_module
from molecule.data import __file__ as data_module


def validate(c):
"""Perform schema validation."""
result = []
schema_file = os.path.dirname(schemas_module) + "/molecule.json"
schema_file = os.path.dirname(data_module) + "/molecule.json"
with open(schema_file, encoding="utf-8") as f:
schema = json.load(f)

Expand Down
1 change: 0 additions & 1 deletion src/molecule/schemas/__init__.py

This file was deleted.

Loading