From 6016ecb9cf25db391eec8eb6f09131ab93d219d4 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 26 Feb 2024 10:33:59 +0100 Subject: [PATCH] Updated openapi and added response type to temp file config --- .../ConfigurationTemporaryFileController.cs | 2 +- src/Umbraco.Cms.Api.Management/OpenApi.json | 426 +++++++++++++++++- 2 files changed, 422 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/ConfigurationTemporaryFileController.cs b/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/ConfigurationTemporaryFileController.cs index 89f80af439..bc86179559 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/ConfigurationTemporaryFileController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/ConfigurationTemporaryFileController.cs @@ -17,7 +17,7 @@ public class ConfigurationTemporaryFileController : TemporaryFileControllerBase [HttpGet("configuration")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(typeof(TemporaryFileConfigurationResponseModel), StatusCodes.Status200OK)] public Task Configuration() { TemporaryFileConfigurationResponseModel responseModel = _temporaryFileConfigurationPresentationFactory.Create(); diff --git a/src/Umbraco.Cms.Api.Management/OpenApi.json b/src/Umbraco.Cms.Api.Management/OpenApi.json index fa6e5613ca..cab8125e2e 100644 --- a/src/Umbraco.Cms.Api.Management/OpenApi.json +++ b/src/Umbraco.Cms.Api.Management/OpenApi.json @@ -6519,6 +6519,216 @@ ] } }, + "/umbraco/management/api/v1/recycle-bin/document/{id}/original-parent": { + "get": { + "tags": [ + "Document" + ], + "operationId": "GetRecycleBinDocumentByIdOriginalParent", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ReferenceByIdModel" + } + ] + } + }, + "text/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ReferenceByIdModel" + } + ] + } + }, + "text/plain": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ReferenceByIdModel" + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "The resource is protected and requires an authentication token" + }, + "403": { + "description": "The authenticated user do not have access to this resource" + } + }, + "security": [ + { + "Backoffice User": [ ] + } + ] + } + }, + "/umbraco/management/api/v1/recycle-bin/document/{id}/restore": { + "put": { + "tags": [ + "Document" + ], + "operationId": "PutRecycleBinDocumentByIdRestore", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MoveMediaRequestModel" + } + ] + } + }, + "text/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MoveMediaRequestModel" + } + ] + } + }, + "application/*+json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MoveMediaRequestModel" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "The resource is protected and requires an authentication token" + }, + "403": { + "description": "The authenticated user do not have access to this resource" + } + }, + "security": [ + { + "Backoffice User": [ ] + } + ] + } + }, "/umbraco/management/api/v1/recycle-bin/document/children": { "get": { "tags": [ @@ -11614,12 +11824,12 @@ ] } }, - "/umbraco/management/api/v1/recycle-bin/media/{id}": { - "delete": { + "/umbraco/management/api/v1/recycle-bin/media/{id}/original-parent": { + "get": { "tags": [ "Media" ], - "operationId": "DeleteRecycleBinMediaById", + "operationId": "GetRecycleBinMediaByIdOriginalParent", "parameters": [ { "name": "id", @@ -11633,7 +11843,56 @@ ], "responses": { "200": { - "description": "Success" + "description": "Success", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ReferenceByIdModel" + } + ] + } + }, + "text/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ReferenceByIdModel" + } + ] + } + }, + "text/plain": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ReferenceByIdModel" + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } }, "400": { "description": "Bad Request", @@ -11655,6 +11914,72 @@ } } }, + "401": { + "description": "The resource is protected and requires an authentication token" + }, + "403": { + "description": "The authenticated user do not have access to this resource" + } + }, + "security": [ + { + "Backoffice User": [ ] + } + ] + } + }, + "/umbraco/management/api/v1/recycle-bin/media/{id}/restore": { + "put": { + "tags": [ + "Media" + ], + "operationId": "PutRecycleBinMediaByIdRestore", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MoveMediaRequestModel" + } + ] + } + }, + "text/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MoveMediaRequestModel" + } + ] + } + }, + "application/*+json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MoveMediaRequestModel" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Success" + }, "404": { "description": "Not Found", "content": { @@ -11675,6 +12000,26 @@ } } }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, "401": { "description": "The resource is protected and requires an authentication token" }, @@ -20788,7 +21133,36 @@ "operationId": "GetTemporaryFileConfiguration", "responses": { "200": { - "description": "Success" + "description": "Success", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/TemporaryFileConfigurationResponseModel" + } + ] + } + }, + "text/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/TemporaryFileConfigurationResponseModel" + } + ] + } + }, + "text/plain": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/TemporaryFileConfigurationResponseModel" + } + ] + } + } + } }, "401": { "description": "The resource is protected and requires an authentication token" @@ -25980,6 +26354,14 @@ } ] } + }, + "collection": { + "oneOf": [ + { + "$ref": "#/components/schemas/ReferenceByIdModel" + } + ], + "nullable": true } }, "additionalProperties": false @@ -31969,6 +32351,40 @@ }, "additionalProperties": false }, + "TemporaryFileConfigurationResponseModel": { + "required": [ + "allowedUploadedFileExtensions", + "disallowedUploadedFilesExtensions", + "imageFileTypes" + ], + "type": "object", + "properties": { + "imageFileTypes": { + "type": "array", + "items": { + "type": "string" + } + }, + "disallowedUploadedFilesExtensions": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowedUploadedFileExtensions": { + "type": "array", + "items": { + "type": "string" + } + }, + "maxFileSize": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, "TemporaryFileResponseModel": { "required": [ "fileName",