diff --git a/apps/webhook_listeners/lib/Controller/WebhooksController.php b/apps/webhook_listeners/lib/Controller/WebhooksController.php index c09da53d5f2c4..42870825877b7 100644 --- a/apps/webhook_listeners/lib/Controller/WebhooksController.php +++ b/apps/webhook_listeners/lib/Controller/WebhooksController.php @@ -26,7 +26,7 @@ use Psr\Log\LoggerInterface; /** - * @psalm-import-type WebhooksListenerInfo from ResponseDefinitions + * @psalm-import-type WebhookListenersWebhookInfo from ResponseDefinitions */ #[OpenAPI(scope: OpenAPI::SCOPE_ADMINISTRATION)] class WebhooksController extends OCSController { @@ -44,7 +44,7 @@ public function __construct( /** * List registered webhooks * - * @return DataResponse + * @return DataResponse * * 200: Webhook registrations returned */ @@ -61,7 +61,7 @@ public function index(): DataResponse { * * @param int $id id of the webhook * - * @return DataResponse + * @return DataResponse * * 200: Webhook registration returned */ @@ -82,7 +82,7 @@ public function show(int $id): DataResponse { * @param "none"|"headers"|null $authMethod Authentication method to use * @param ?array $authData Array of data for authentication * - * @return DataResponse + * @return DataResponse * * 200: Webhook registration returned * @@ -141,7 +141,7 @@ public function create( * @param "none"|"headers"|null $authMethod Authentication method to use * @param ?array $authData Array of data for authentication * - * @return DataResponse + * @return DataResponse * * 200: Webhook registration returned * diff --git a/apps/webhook_listeners/lib/ResponseDefinitions.php b/apps/webhook_listeners/lib/ResponseDefinitions.php index 3b9965c20a31f..cb33f93e8ffda 100644 --- a/apps/webhook_listeners/lib/ResponseDefinitions.php +++ b/apps/webhook_listeners/lib/ResponseDefinitions.php @@ -10,7 +10,7 @@ namespace OCA\WebhookListeners; /** - * @psalm-type WebhooksListenerInfo = array{ + * @psalm-type WebhookListenersWebhookInfo = array{ * id: string, * userId: string, * httpMethod: string, diff --git a/apps/webhook_listeners/openapi.json b/apps/webhook_listeners/openapi.json index 6d8a10fcdea0a..308f0e8b11df4 100644 --- a/apps/webhook_listeners/openapi.json +++ b/apps/webhook_listeners/openapi.json @@ -1,7 +1,7 @@ { "openapi": "3.0.3", "info": { - "title": "webhooks", + "title": "webhook_listeners", "version": "0.0.1", "description": "Nextcloud webhook support", "license": { @@ -20,7 +20,31 @@ } }, "schemas": { - "ListenerInfo": { + "OCSMeta": { + "type": "object", + "required": [ + "status", + "statuscode" + ], + "properties": { + "status": { + "type": "string" + }, + "statuscode": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "totalitems": { + "type": "string" + }, + "itemsperpage": { + "type": "string" + } + } + }, + "WebhookInfo": { "type": "object", "required": [ "id", @@ -67,35 +91,11 @@ } } } - }, - "OCSMeta": { - "type": "object", - "required": [ - "status", - "statuscode" - ], - "properties": { - "status": { - "type": "string" - }, - "statuscode": { - "type": "integer" - }, - "message": { - "type": "string" - }, - "totalitems": { - "type": "string" - }, - "itemsperpage": { - "type": "string" - } - } } } }, "paths": { - "/ocs/v2.php/apps/webhooks/api/v1/webhooks": { + "/ocs/v2.php/apps/webhook_listeners/api/v1/webhooks": { "get": { "operationId": "webhooks-index", "summary": "List registered webhooks", @@ -147,7 +147,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ListenerInfo" + "$ref": "#/components/schemas/WebhookInfo" } } } @@ -275,7 +275,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "$ref": "#/components/schemas/ListenerInfo" + "$ref": "#/components/schemas/WebhookInfo" } } } @@ -343,7 +343,7 @@ } } }, - "/ocs/v2.php/apps/webhooks/api/v1/webhooks/{id}": { + "/ocs/v2.php/apps/webhook_listeners/api/v1/webhooks/{id}": { "get": { "operationId": "webhooks-show", "summary": "Get details on a registered webhook", @@ -403,7 +403,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "$ref": "#/components/schemas/ListenerInfo" + "$ref": "#/components/schemas/WebhookInfo" } } } @@ -540,7 +540,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "$ref": "#/components/schemas/ListenerInfo" + "$ref": "#/components/schemas/WebhookInfo" } } } @@ -736,4 +736,4 @@ } }, "tags": [] -} +} \ No newline at end of file