Compare commits

...

3 Commits

Author SHA1 Message Date
dgtlmoon
8cac46467e Allow empty strings 2025-02-09 22:24:29 +01:00
dgtlmoon
5c63f346ac Improved rule 2025-02-09 22:14:17 +01:00
dgtlmoon
b15c9632c8 Adding browser_steps json schema rule for API 2025-02-09 22:12:41 +01:00

View File

@@ -112,6 +112,35 @@ 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"],
"maxLength": 5000 # Allows null and any string up to 5000 chars (including "")
},
"selector": {
"type": ["string", "null"],
"maxLength": 5000
},
"optional_value": {
"type": ["string", "null"],
"maxLength": 5000
}
},
"required": ["operation", "selector", "optional_value"],
"additionalProperties": False # No extra keys allowed
}
},
{"type": "null"}, # Allows null for `browser_steps`
{"type": "array", "maxItems": 0} # Allows empty array []
]
}
# headers ?
return schema