diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php index 847a1d32b1..bf2b198890 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php @@ -47,7 +47,9 @@ class Create extends Action ->label('sdk', new Method( namespace: 'tokens', name: 'createFileToken', - description: '', + description: <<label('sdk', new Method( namespace: 'tokens', name: 'list', - description: '', + description: <<label('sdk', new Method( namespace: 'tokens', name: 'delete', - description: '', + description: <<label('sdk', new Method( namespace: 'tokens', name: 'get', - description: '', + description: <<label('sdk', new Method( namespace: 'tokens', name: 'getJWT', - description: '', + description: <<label('sdk', new Method( namespace: 'tokens', name: 'update', - description: '', + description: <<getDescriptionFilePath(); + if (\str_ends_with($desc, '.md')) { + $descPath = $this->getDescriptionFilePath(); - if (empty($descPath)) { - self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}"; - return; + if (empty($descPath)) { + self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}"; + return; + } } } diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index bd5405539d..e60d342b0b 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -177,11 +177,14 @@ class OpenAPI3 extends Format $namespace = $sdk->getNamespace() ?? 'default'; + $desc = $desc ?? ''; + $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc; + $temp = [ 'summary' => $route->getDesc(), 'operationId' => $namespace . ucfirst($method), 'tags' => [$namespace], - 'description' => ($desc) ? \file_get_contents($desc) : '', + 'description' => $descContents, 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 7277e3ab2b..fae164f0a6 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -173,13 +173,16 @@ class Swagger2 extends Format $namespace = $sdk->getNamespace() ?? 'default'; + $desc = $desc ?? ''; + $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc; + $temp = [ 'summary' => $route->getDesc(), 'operationId' => $namespace . ucfirst($method), 'consumes' => [], 'produces' => [], 'tags' => [$namespace], - 'description' => ($desc) ? \file_get_contents($desc) : '', + 'description' => $descContents, 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method,