diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 3be3fe7115..99538bc8f2 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -4,6 +4,7 @@ namespace Appwrite\SDK\Specification\Format; use Appwrite\Platform\Tasks\Specs; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response; @@ -291,6 +292,21 @@ class OpenAPI3 extends Format } if (!(\is_array($model)) && $model->isNone()) { + if ($produces === ContentType::TEXT->value && $response->getCode() !== 204) { + $temp['responses'][(string)$response->getCode()] = [ + 'description' => 'Text', + 'content' => [ + $produces => [ + 'schema' => [ + 'type' => 'string', + ], + ], + ], + ]; + + continue; + } + $temp['responses'][(string)$response->getCode()] = [ 'description' => in_array($produces, [ 'image/*', diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 9a16bc8bbe..fb1ef66eca 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -4,6 +4,7 @@ namespace Appwrite\SDK\Specification\Format; use Appwrite\Platform\Tasks\Specs; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response; @@ -298,6 +299,17 @@ class Swagger2 extends Format } if (!(\is_array($model)) && $model->isNone()) { + if ($produces === ContentType::TEXT->value && !\in_array($response->getCode(), [204, 301, 302, 308], true)) { + $temp['responses'][(string)$response->getCode()] = [ + 'description' => 'Text', + 'schema' => [ + 'type' => 'string', + ], + ]; + + continue; + } + $temp['responses'][(string)$response->getCode()] = [ 'description' => in_array($produces, [ 'image/*',