diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Projects/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Projects/XList.php index c42b847a19..9a140cbdf8 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Projects/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Projects/XList.php @@ -17,6 +17,7 @@ use Utopia\Database\Query; use Utopia\Database\Validator\Query\Cursor; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; +use Utopia\Validator; use Utopia\Validator\Text; class XList extends Action @@ -26,9 +27,14 @@ class XList extends Action { return 'listProjects'; } + + // Stored as property intentionally for extensibility + protected Validator $queriesValidator; public function __construct() { + $this->queriesValidator = new Projects(); + $this ->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) ->setHttpPath('/v1/projects') @@ -51,7 +57,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->queriesValidator, '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) ->inject('response') ->inject('dbForPlatform')