diff --git a/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php index 6c7d9dfaef..61e9a3183d 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php @@ -19,6 +19,7 @@ use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Query; use Utopia\Database\Validator\Query\Cursor; use Utopia\Platform\Scope\HTTP; +use Utopia\Validator; use Utopia\Validator\Boolean; use Utopia\Validator\Text; @@ -34,6 +35,11 @@ class XList extends Action return 'listProjects'; } + protected function getQueriesValidator(): Validator + { + return new Projects(); + } + public function __construct() { $this @@ -58,7 +64,7 @@ class XList extends Action ], contentType: ContentType::JSON )) - ->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) + ->param('queries', [], $this->getQueriesValidator(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) ->inject('request') diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Types.php b/src/Appwrite/Utopia/Database/Validator/Queries/Types.php index a70576cd86..285521b264 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Types.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Types.php @@ -22,7 +22,7 @@ class Types extends Validator /** * @var array */ - protected array $allowedAttributes; + private array $allowedAttributes; /** * @param array $types