diff --git a/composer.lock b/composer.lock index c1e5587311..df992e9534 100644 --- a/composer.lock +++ b/composer.lock @@ -3797,16 +3797,16 @@ }, { "name": "utopia-php/database", - "version": "5.2.1", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "adfdf201144353a1d2ce14bb197ab746079894e0" + "reference": "5e49f32ebb6e40a78209231564c40e5068810429" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/adfdf201144353a1d2ce14bb197ab746079894e0", - "reference": "adfdf201144353a1d2ce14bb197ab746079894e0", + "url": "https://api.github.com/repos/utopia-php/database/zipball/5e49f32ebb6e40a78209231564c40e5068810429", + "reference": "5e49f32ebb6e40a78209231564c40e5068810429", "shasum": "" }, "require": { @@ -3849,9 +3849,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/5.2.1" + "source": "https://github.com/utopia-php/database/tree/5.3.0" }, - "time": "2026-02-16T11:01:13+00:00" + "time": "2026-02-17T11:50:01+00:00" }, { "name": "utopia-php/detector", @@ -5385,16 +5385,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "1.9.2", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "74de906ea5051030c5299a5d4aa74d963a531130" + "reference": "5a8a304e404c84539f3ac6562c736f8c7ef2bef2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/74de906ea5051030c5299a5d4aa74d963a531130", - "reference": "74de906ea5051030c5299a5d4aa74d963a531130", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/5a8a304e404c84539f3ac6562c736f8c7ef2bef2", + "reference": "5a8a304e404c84539f3ac6562c736f8c7ef2bef2", "shasum": "" }, "require": { @@ -5430,9 +5430,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/1.9.2" + "source": "https://github.com/appwrite/sdk-generator/tree/1.9.3" }, - "time": "2026-02-16T06:59:54+00:00" + "time": "2026-02-17T11:48:05+00:00" }, { "name": "brianium/paratest", @@ -6778,16 +6778,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.5.11", + "version": "12.5.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9b518cb40f9474572c9f0178e96ff3dc1cf02bf1" + "reference": "418e06b3b46b0d54bad749ff4907fc7dfb530199" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b518cb40f9474572c9f0178e96ff3dc1cf02bf1", - "reference": "9b518cb40f9474572c9f0178e96ff3dc1cf02bf1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/418e06b3b46b0d54bad749ff4907fc7dfb530199", + "reference": "418e06b3b46b0d54bad749ff4907fc7dfb530199", "shasum": "" }, "require": { @@ -6856,7 +6856,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.11" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.12" }, "funding": [ { @@ -6880,7 +6880,7 @@ "type": "tidelift" } ], - "time": "2026-02-10T12:32:02+00:00" + "time": "2026-02-16T08:34:36+00:00" }, { "name": "psr/cache", diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 8e710cd0ac..1a3fffb479 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -839,6 +839,7 @@ class OpenAPI3 extends Format case 'string': case 'datetime': case 'payload': + case 'id': $type = 'string'; break; diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index d70bda9285..bad6117d07 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -819,6 +819,7 @@ class Swagger2 extends Format switch ($rule['type']) { case 'string': case 'datetime': + case 'id': $type = 'string'; break; diff --git a/src/Appwrite/Utopia/Response/Model.php b/src/Appwrite/Utopia/Response/Model.php index 687b8b3eba..b32894ab3c 100644 --- a/src/Appwrite/Utopia/Response/Model.php +++ b/src/Appwrite/Utopia/Response/Model.php @@ -17,6 +17,7 @@ abstract class Model public const TYPE_PAYLOAD = 'payload'; public const TYPE_ARRAY = 'array'; public const TYPE_ENUM = 'enum'; + public const TYPE_ID = 'id'; /** * @var bool diff --git a/src/Appwrite/Utopia/Response/Model/Document.php b/src/Appwrite/Utopia/Response/Model/Document.php index 1fed9b26cf..f5fe25f233 100644 --- a/src/Appwrite/Utopia/Response/Model/Document.php +++ b/src/Appwrite/Utopia/Response/Model/Document.php @@ -37,7 +37,7 @@ class Document extends Any 'example' => '5e5ea5c16897e', ]) ->addRule('$sequence', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ID, 'description' => 'Document sequence ID.', 'default' => '', 'example' => '1', @@ -85,7 +85,7 @@ class Document extends Any if (!$document->isEmpty()) { $sequence = $document->getAttribute('$sequence', ''); - $document->setAttribute('$sequence', (string)$sequence); + $document->setAttribute('$sequence', $sequence); } foreach ($document->getAttributes() as $attribute) { diff --git a/src/Appwrite/Utopia/Response/Model/Row.php b/src/Appwrite/Utopia/Response/Model/Row.php index 8f663f92af..e1ea132d0b 100644 --- a/src/Appwrite/Utopia/Response/Model/Row.php +++ b/src/Appwrite/Utopia/Response/Model/Row.php @@ -37,7 +37,7 @@ class Row extends Any 'example' => '5e5ea5c16897e', ]) ->addRule('$sequence', [ - 'type' => self::TYPE_STRING, + 'type' => self::TYPE_ID, 'description' => 'Row sequence ID.', 'default' => '', 'example' => '1', @@ -83,7 +83,7 @@ class Row extends Any $document->removeAttribute('$collection'); $document->removeAttribute('$tenant'); $sequence = $document->getAttribute('$sequence', ''); - $document->setAttribute('$sequence', (string)$sequence); + $document->setAttribute('$sequence', $sequence); foreach ($document->getAttributes() as $column) { if (\is_array($column)) { diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 9e8665ee97..35000ef593 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -2198,11 +2198,13 @@ trait DatabasesBase ]), []); $this->assertIsArray($collectionResponse['body']['indexes']); - $this->assertCount(4, $collectionResponse['body']['indexes']); - $this->assertEquals($titleIndex['body']['key'], $collectionResponse['body']['indexes'][0]['key']); - $this->assertEquals($releaseYearIndex['body']['key'], $collectionResponse['body']['indexes'][1]['key']); - $this->assertEquals($releaseWithDate1['body']['key'], $collectionResponse['body']['indexes'][2]['key']); - $this->assertEquals($releaseWithDate2['body']['key'], $collectionResponse['body']['indexes'][3]['key']); + $expectedIndexCount = $this->getMaxIndexLength() < 1024 ? 4 : 5; // MongoDB accepts tooLong index + $this->assertCount($expectedIndexCount, $collectionResponse['body']['indexes']); + $indexKeys = array_column($collectionResponse['body']['indexes'], 'key'); + $this->assertContains($titleIndex['body']['key'], $indexKeys); + $this->assertContains($releaseYearIndex['body']['key'], $indexKeys); + $this->assertContains($releaseWithDate1['body']['key'], $indexKeys); + $this->assertContains($releaseWithDate2['body']['key'], $indexKeys); $this->assertEventually(function () use ($databaseId, $collectionId) { $collResp = $this->client->call(Client::METHOD_GET, $this->getContainerUrl($databaseId, $collectionId), array_merge([