diff --git a/tests/appinfo/routes.php b/tests/appinfo/routes.php index e6e80dd..25abb65 100644 --- a/tests/appinfo/routes.php +++ b/tests/appinfo/routes.php @@ -42,5 +42,6 @@ ['name' => 'Settings#intParameterWithMinAndMax', 'url' => '/api/{apiVersion}/min-max', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']], ['name' => 'Settings#intParameterWithMin', 'url' => '/api/{apiVersion}/min', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']], ['name' => 'Settings#intParameterWithMax', 'url' => '/api/{apiVersion}/max', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']], + ['name' => 'Settings#listOfIntStringAndBool', 'url' => '/api/{apiVersion}/mixed-list', 'verb' => 'POST', 'requirements' => ['apiVersion' => '(v2)']], ], ]; diff --git a/tests/lib/Controller/SettingsController.php b/tests/lib/Controller/SettingsController.php index 3742176..3ea4047 100644 --- a/tests/lib/Controller/SettingsController.php +++ b/tests/lib/Controller/SettingsController.php @@ -209,4 +209,16 @@ public function intParameterWithMin(int $limit): DataResponse { public function intParameterWithMax(int $limit): DataResponse { return new DataResponse(); } + + /** + * A route with a list of 2 integers, 2 strings and 1 boolean + * + * @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.json b/tests/openapi.json index 4933d18..9b6d173 100644 --- a/tests/openapi.json +++ b/tests/openapi.json @@ -1272,6 +1272,105 @@ } } } + }, + "/ocs/v2.php/apps/notifications/api/{apiVersion}/mixed-list": { + "post": { + "operationId": "settings-list-of-int-string-and-bool", + "summary": "A route with a list of 2 integers, 2 strings and 1 boolean", + "description": "This endpoint requires admin access", + "tags": [ + "settings" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "weird", + "in": "query", + "description": "Weird list", + "required": true, + "schema": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "integer", + "enum": [ + 0, + 1 + ] + }, + { + "type": "string", + "enum": [ + "yes", + "no" + ] + } + ] + } + }, + { + "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": []