diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 37a6604c49..74650a2b18 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -400,7 +400,7 @@ App::get('/v1/account/tokens/oauth2/:provider') ->label('error', __DIR__ . '/../../views/general/error.phtml') ->label('scope', 'sessions.write') ->label('sdk.auth', []) - ->label('sdk.hideServer', true) + ->label('sdk.hideClient', true) ->label('sdk.namespace', 'account') ->label('sdk.method', 'createOAuth2Token') ->label('sdk.description', '/docs/references/account/create-token-oauth2.md') diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 6fabde14cf..c098dc4709 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -150,10 +150,14 @@ class Swagger2 extends Format } if (empty($routeSecurity)) { - $sdkPlatforms[] = APP_PLATFORM_CLIENT; - $sdkPlatforms[] = APP_PLATFORM_SERVER; + if (!$route->getLabel('sdk.hideServer', false)) { + $sdkPlatforms[] = APP_PLATFORM_SERVER; + } + if (!$route->getLabel('sdk.hideClient', false)) { + $sdkPlatforms[] = APP_PLATFORM_CLIENT; + } } - + $temp = [ 'summary' => $route->getDesc(), 'operationId' => $route->getLabel('sdk.namespace', 'default') . ucfirst($method),