diff --git a/generate-spec.php b/generate-spec.php index 1425328..c1d4b0c 100755 --- a/generate-spec.php +++ b/generate-spec.php @@ -466,6 +466,8 @@ if ($scopes === []) { if ($controllerScopes !== []) { $scopes = $controllerScopes; + } elseif (!$isOCS) { + $scopes = ['ignore']; } elseif ($isExApp) { $scopes = ['ex_app']; } elseif ($isAdmin) { diff --git a/tests/lib/Controller/PlainController.php b/tests/lib/Controller/PlainController.php new file mode 100644 index 0000000..e5c5ba9 --- /dev/null +++ b/tests/lib/Controller/PlainController.php @@ -0,0 +1,40 @@ + + * + * 200: Response returned + */ + #[NoCSRFRequired] + #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT)] + #[FrontpageRoute(verb: 'GET', url: '/plain/with-scope')] + public function withScope(): Response { + return new Response(); + } +} diff --git a/tests/openapi-full.json b/tests/openapi-full.json index 14c533e..2519a54 100644 --- a/tests/openapi-full.json +++ b/tests/openapi-full.json @@ -5485,6 +5485,29 @@ } } }, + "/index.php/apps/notifications/plain/with-scope": { + "get": { + "operationId": "plain-with-scope", + "summary": "Route with manual scope to not get ignored", + "description": "This endpoint requires admin access", + "tags": [ + "plain" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "responses": { + "200": { + "description": "Response returned" + } + } + } + }, "/ocs/v2.php/apps/notifications/api/{apiVersion}/ex-app-attribute": { "post": { "operationId": "ex_app_settings-ex-app-scope-attribute", diff --git a/tests/openapi.json b/tests/openapi.json index 57520b8..6173bb9 100644 --- a/tests/openapi.json +++ b/tests/openapi.json @@ -797,6 +797,29 @@ } } } + }, + "/index.php/apps/notifications/plain/with-scope": { + "get": { + "operationId": "plain-with-scope", + "summary": "Route with manual scope to not get ignored", + "description": "This endpoint requires admin access", + "tags": [ + "plain" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "responses": { + "200": { + "description": "Response returned" + } + } + } } }, "tags": []