diff --git a/tests/appinfo/routes.php b/tests/appinfo/routes.php index 8e734e3..0a13f92 100644 --- a/tests/appinfo/routes.php +++ b/tests/appinfo/routes.php @@ -32,6 +32,7 @@ ['name' => 'Settings#adminScope', 'url' => '/api/{apiVersion}/admin', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']], ['name' => 'Settings#doubleScope', 'url' => '/api/{apiVersion}/double', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']], ['name' => 'Settings#listOfIntParameters', 'url' => '/api/{apiVersion}/list-of-int', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']], + ['name' => 'Settings#listOfIntStringAndBool', 'url' => '/api/{apiVersion}/weird-list', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']], ['name' => 'Settings2#defaultAdminScopeOverwritten', 'url' => '/api/{apiVersion}/default-admin-overwritten', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']], ['name' => 'Settings2#defaultAdminScope', 'url' => '/api/{apiVersion}/default-admin', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']], diff --git a/tests/lib/Controller/SettingsController.php b/tests/lib/Controller/SettingsController.php index d80641c..7093027 100644 --- a/tests/lib/Controller/SettingsController.php +++ b/tests/lib/Controller/SettingsController.php @@ -131,4 +131,16 @@ public function doubleScope(): DataResponse { public function listOfIntParameters(int $limit): DataResponse { return new DataResponse(); } + + /** + * A route with a limited set of possible integers + * + * @param 0|1|'yes'|'no'|true $weird Weird list + * @return DataResponse, array{}> + * + * 200: Admin settings updated + */ + public function listOfIntStringAndBool($weird): DataResponse { + return new DataResponse(); + } } diff --git a/tests/openapi-federation.json b/tests/openapi-federation.json index f3a5449..26ab269 100644 --- a/tests/openapi-federation.json +++ b/tests/openapi-federation.json @@ -211,6 +211,87 @@ } } } + }, + "/ocs/v2.php/apps/notifications/api/{apiVersion}/weird-list": { + "post": { + "operationId": "settings-list-of-int-string-and-bool", + "summary": "A route with a limited set of possible integers", + "description": "This endpoint requires admin access", + "tags": [ + "settings" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "weird", + "in": "query", + "description": "Weird list", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "apiVersion", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "v2" + ], + "default": "v2" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "Admin settings updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + } + } + } } }, "tags": []