From 82c4fb8afae80851296a1c2ebf8aa01f03244e1d Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 13 Mar 2024 17:14:41 +0100 Subject: [PATCH] docs(openapi): update specs Signed-off-by: Arthur Schiwon --- openapi.json | 145 +++++++++++++++++++++++++++++++++++ src/types/openapi/openapi.ts | 53 +++++++++++++ 2 files changed, 198 insertions(+) diff --git a/openapi.json b/openapi.json index b6af3bbf1..5a96f7ff9 100644 --- a/openapi.json +++ b/openapi.json @@ -8475,6 +8475,151 @@ } } } + }, + "delete": { + "operationId": "context-destroy", + "summary": "[api v2] Delete an existing context and return it", + "tags": [ + "context" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "contextId", + "in": "path", + "description": "ID of the context", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "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": "returning the full context information", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/Context" + } + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } } }, "/ocs/v2.php/apps/tables/api/2/contexts/{contextId}/transfer": { diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 96936503a..236c7d17d 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -205,6 +205,8 @@ export type paths = { get: operations["context-show"]; /** [api v2] Update an existing context and return it */ put: operations["context-update"]; + /** [api v2] Delete an existing context and return it */ + delete: operations["context-destroy"]; }; "/ocs/v2.php/apps/tables/api/2/contexts/{contextId}/transfer": { /** [api v2] Transfer the ownership of a context and return it */ @@ -3164,6 +3166,57 @@ export type operations = { }; }; }; + /** [api v2] Delete an existing context and return it */ + "context-destroy": { + parameters: { + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the context */ + contextId: number; + }; + }; + responses: { + /** @description returning the full context information */ + 200: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["Context"]; + }; + }; + }; + }; + /** @description Not found */ + 404: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; /** [api v2] Transfer the ownership of a context and return it */ "context-transfer": { parameters: {