Skip to content

Commit

Permalink
Adding browser_steps json schema rule for API
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtlmoon committed Feb 9, 2025
1 parent 09ebc6e commit b15c963
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions changedetectionio/api/api_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b15c963

Please sign in to comment.