summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorjld3103 <jld3103yt@gmail.com>2023-09-19 14:12:17 +0200
committerjld3103 <jld3103yt@gmail.com>2023-09-27 08:05:21 +0200
commitc2d45cb1728e2191e51424734e74cb2a56b323b0 (patch)
tree0c46d10f4e5ef18bf0771069dd2a896da788b4ba /core
parent912b18b1fc9fd90bfc78f942cd2043a5a0145e69 (diff)
downloadnextcloud-server-c2d45cb1728e2191e51424734e74cb2a56b323b0.tar.gz
nextcloud-server-c2d45cb1728e2191e51424734e74cb2a56b323b0.zip
Add single status code descriptions for OpenAPI
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/Controller/AutoCompleteController.php2
-rw-r--r--core/Controller/ClientFlowLoginV2Controller.php2
-rw-r--r--core/Controller/OCSController.php2
-rw-r--r--core/Controller/ReferenceApiController.php10
-rw-r--r--core/Controller/TextProcessingApiController.php2
-rw-r--r--core/Controller/TranslationApiController.php2
-rw-r--r--core/Controller/UnifiedSearchController.php2
-rw-r--r--core/openapi.json22
8 files changed, 33 insertions, 11 deletions
diff --git a/core/Controller/AutoCompleteController.php b/core/Controller/AutoCompleteController.php
index 15b78e53dc0..fd7f9188f96 100644
--- a/core/Controller/AutoCompleteController.php
+++ b/core/Controller/AutoCompleteController.php
@@ -68,6 +68,8 @@ class AutoCompleteController extends OCSController {
* @param int $limit Maximum number of results to return
*
* @return DataResponse<Http::STATUS_OK, CoreAutocompleteResult[], array{}>
+ *
+ * 200: Autocomplete results returned
*/
public function get(string $search, ?string $itemType, ?string $itemId, ?string $sorter = null, array $shareTypes = [IShare::TYPE_USER], int $limit = 10): DataResponse {
// if enumeration/user listings are disabled, we'll receive an empty
diff --git a/core/Controller/ClientFlowLoginV2Controller.php b/core/Controller/ClientFlowLoginV2Controller.php
index b03f961742e..8aafabf9892 100644
--- a/core/Controller/ClientFlowLoginV2Controller.php
+++ b/core/Controller/ClientFlowLoginV2Controller.php
@@ -288,6 +288,8 @@ class ClientFlowLoginV2Controller extends Controller {
* Init a login flow
*
* @return JSONResponse<Http::STATUS_OK, CoreLoginFlowV2, array{}>
+ *
+ * 200: Login flow init returned
*/
public function init(): JSONResponse {
// Get client user agent
diff --git a/core/Controller/OCSController.php b/core/Controller/OCSController.php
index 64234a65634..3669c006a0b 100644
--- a/core/Controller/OCSController.php
+++ b/core/Controller/OCSController.php
@@ -71,6 +71,8 @@ class OCSController extends \OCP\AppFramework\OCSController {
* Get the capabilities
*
* @return DataResponse<Http::STATUS_OK, array{version: array{major: int, minor: int, micro: int, string: string, edition: '', extendedSupport: bool}, capabilities: array<string, mixed>}, array{}>
+ *
+ * 200: Capabilities returned
*/
public function getCapabilities(): DataResponse {
$result = [];
diff --git a/core/Controller/ReferenceApiController.php b/core/Controller/ReferenceApiController.php
index 3d144c8559f..384011f8020 100644
--- a/core/Controller/ReferenceApiController.php
+++ b/core/Controller/ReferenceApiController.php
@@ -56,6 +56,8 @@ class ReferenceApiController extends \OCP\AppFramework\OCSController {
* @param bool $resolve Resolve the references
* @param int $limit Maximum amount of references to extract
* @return DataResponse<Http::STATUS_OK, array{references: array<string, CoreReference|null>}, array{}>
+ *
+ * 200: References returned
*/
public function extract(string $text, bool $resolve = false, int $limit = 1): DataResponse {
$references = $this->referenceManager->extractReferences($text);
@@ -82,6 +84,8 @@ class ReferenceApiController extends \OCP\AppFramework\OCSController {
*
* @param string $reference Reference to resolve
* @return DataResponse<Http::STATUS_OK, array{references: array<string, ?CoreReference>}, array{}>
+ *
+ * 200: Reference returned
*/
public function resolveOne(string $reference): DataResponse {
/** @var ?CoreReference $resolvedReference */
@@ -100,6 +104,8 @@ class ReferenceApiController extends \OCP\AppFramework\OCSController {
* @param string[] $references References to resolve
* @param int $limit Maximum amount of references to resolve
* @return DataResponse<Http::STATUS_OK, array{references: array<string, CoreReference|null>}, array{}>
+ *
+ * 200: References returned
*/
public function resolve(array $references, int $limit = 1): DataResponse {
$result = [];
@@ -123,6 +129,8 @@ class ReferenceApiController extends \OCP\AppFramework\OCSController {
* Get the providers
*
* @return DataResponse<Http::STATUS_OK, CoreReferenceProvider[], array{}>
+ *
+ * 200: Providers returned
*/
public function getProvidersInfo(): DataResponse {
$providers = $this->referenceManager->getDiscoverableProviders();
@@ -140,6 +148,8 @@ class ReferenceApiController extends \OCP\AppFramework\OCSController {
* @param string $providerId ID of the provider
* @param int|null $timestamp Timestamp of the last usage
* @return DataResponse<Http::STATUS_OK, array{success: bool}, array{}>
+ *
+ * 200: Provider touched
*/
public function touchProvider(string $providerId, ?int $timestamp = null): DataResponse {
if ($this->userId !== null) {
diff --git a/core/Controller/TextProcessingApiController.php b/core/Controller/TextProcessingApiController.php
index 89ef0d105fe..8b5175f0e5c 100644
--- a/core/Controller/TextProcessingApiController.php
+++ b/core/Controller/TextProcessingApiController.php
@@ -66,6 +66,8 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
* This endpoint returns all available LanguageModel task types
*
* @return DataResponse<Http::STATUS_OK, array{types: array{id: string, name: string, description: string}[]}, array{}>
+ *
+ * 200: Task types returned
*/
#[PublicPage]
public function taskTypes(): DataResponse {
diff --git a/core/Controller/TranslationApiController.php b/core/Controller/TranslationApiController.php
index 3f70a5bcb05..c4f3c8e855e 100644
--- a/core/Controller/TranslationApiController.php
+++ b/core/Controller/TranslationApiController.php
@@ -52,6 +52,8 @@ class TranslationApiController extends \OCP\AppFramework\OCSController {
* Get the list of supported languages
*
* @return DataResponse<Http::STATUS_OK, array{languages: array{from: string, fromLabel: string, to: string, toLabel: string}[], languageDetection: bool}, array{}>
+ *
+ * 200: Supported languages returned
*/
public function languages(): DataResponse {
return new DataResponse([
diff --git a/core/Controller/UnifiedSearchController.php b/core/Controller/UnifiedSearchController.php
index 346717599e0..d0dfd1bf7da 100644
--- a/core/Controller/UnifiedSearchController.php
+++ b/core/Controller/UnifiedSearchController.php
@@ -64,6 +64,8 @@ class UnifiedSearchController extends OCSController {
*
* @param string $from the url the user is currently at
* @return DataResponse<Http::STATUS_OK, CoreUnifiedSearchProvider[], array{}>
+ *
+ * 200: Providers returned
*/
public function getProviders(string $from = ''): DataResponse {
[$route, $parameters] = $this->getRouteInformation($from);
diff --git a/core/openapi.json b/core/openapi.json
index 74e67b28691..602981351f5 100644
--- a/core/openapi.json
+++ b/core/openapi.json
@@ -858,7 +858,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "Login flow init returned",
"content": {
"application/json": {
"schema": {
@@ -1423,7 +1423,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "Capabilities returned",
"content": {
"application/json": {
"schema": {
@@ -1787,7 +1787,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "Autocomplete results returned",
"content": {
"application/json": {
"schema": {
@@ -3322,7 +3322,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "Reference returned",
"content": {
"application/json": {
"schema": {
@@ -3414,7 +3414,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "References returned",
"content": {
"application/json": {
"schema": {
@@ -3514,7 +3514,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "References returned",
"content": {
"application/json": {
"schema": {
@@ -3586,7 +3586,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "Providers returned",
"content": {
"application/json": {
"schema": {
@@ -3668,7 +3668,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "Provider touched",
"content": {
"application/json": {
"schema": {
@@ -3860,7 +3860,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "Providers returned",
"content": {
"application/json": {
"schema": {
@@ -4070,7 +4070,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "Supported languages returned",
"content": {
"application/json": {
"schema": {
@@ -4393,7 +4393,7 @@
],
"responses": {
"200": {
- "description": "",
+ "description": "Task types returned",
"content": {
"application/json": {
"schema": {