Adding browser_steps json schema rule for API

This commit is contained in:
dgtlmoon
2025-02-09 22:12:41 +01:00
parent 09ebc6ec63
commit b15c9632c8
+21
View File
@@ -112,6 +112,27 @@ def build_watch_json_schema(d):
schema['properties']['time_between_check'] = build_time_between_check_json_schema()
schema['properties']['browser_steps'] = {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"properties": {
"operation": {"type": ["string", "null"]},
"selector": {"type": "string"},
"optional_value": {"type": "string"}
},
"required": ["operation", "selector", "optional_value"],
"additionalProperties": False # Ensures no extra keys are allowed
}
},
{"type": "null"}, # Allows null
{"type": "array", "maxItems": 0}, # Allows empty array []
{"type": "string", "enum": ["none"]} # Allows string "none"
]
}
# headers ?
return schema