Check for documentId on ops that require it

This commit is contained in:
Jake Barnby 2025-08-15 01:33:22 +12:00
parent 46f8d76d7a
commit 2b3795224d
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -71,6 +71,15 @@ class Operation extends Validator
return false;
}
// If action requires documentId, it must be present
if (
isset($this->requiresDocumentId[$value['action']]) &&
!\array_key_exists('documentId', $value)
) {
$this->description = "Key 'documentId' is required for action '{$value['action']}'";
return false;
}
// Data must be array (can be empty)
if (!\is_array($value['data'])) {
$this->description = "Key 'data' must be an array";