Skip to content

Commit

Permalink
Allow empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtlmoon committed Feb 9, 2025
1 parent 5c63f34 commit 8cac464
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions changedetectionio/api/api_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,24 @@ def build_watch_json_schema(d):
"items": {
"type": "object",
"properties": {
"operation": {"type": ["string", "null"]},
"selector": {"type": "string"},
"optional_value": {"type": "string"}
"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 # Ensures no extra keys are allowed
"additionalProperties": False # No extra keys allowed
}
},
{"type": "null"}, # Allows null
{"type": "null"}, # Allows null for `browser_steps`
{"type": "array", "maxItems": 0} # Allows empty array []
]
}
Expand Down

0 comments on commit 8cac464

Please sign in to comment.