diff --git a/src/Umbraco.Cms.Api.Management/Content/ContentControllerBase.cs b/src/Umbraco.Cms.Api.Management/Content/ContentControllerBase.cs index 3533da2a1d..2d3e11614b 100644 --- a/src/Umbraco.Cms.Api.Management/Content/ContentControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Content/ContentControllerBase.cs @@ -15,13 +15,19 @@ public class ContentControllerBase : ManagementApiControllerBase .WithTitle("Cancelled by notification") .WithDetail("A notification handler prevented the content operation.") .Build()), - ContentEditingOperationStatus.ContentTypeNotFound => NotFound("The content type could not be found"), + ContentEditingOperationStatus.ContentTypeNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("Cancelled by notification") + .Build()), ContentEditingOperationStatus.ContentTypeCultureVarianceMismatch => BadRequest(new ProblemDetailsBuilder() .WithTitle("Content type culture variance mismatch") .WithDetail("The content type variance did not match that of the passed content data.") .Build()), - ContentEditingOperationStatus.NotFound => NotFound("The content could not be found"), - ContentEditingOperationStatus.ParentNotFound => NotFound("The targeted content parent could not be found"), + ContentEditingOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The content could not be found") + .Build()), + ContentEditingOperationStatus.ParentNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The targeted content parent could not be found") + .Build()), ContentEditingOperationStatus.ParentInvalid => BadRequest(new ProblemDetailsBuilder() .WithTitle("Invalid parent") .WithDetail("The targeted parent was not valid for the operation.") @@ -30,33 +36,51 @@ public class ContentControllerBase : ManagementApiControllerBase .WithTitle("Operation not permitted") .WithDetail("The attempted operation was not permitted, likely due to a permission/configuration mismatch with the operation.") .Build()), - ContentEditingOperationStatus.TemplateNotFound => NotFound("The template could not be found"), + ContentEditingOperationStatus.TemplateNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The template could not be found") + .Build()), ContentEditingOperationStatus.TemplateNotAllowed => BadRequest(new ProblemDetailsBuilder() .WithTitle("Template not allowed") .WithDetail("The selected template was not allowed for the operation.") .Build()), - ContentEditingOperationStatus.PropertyTypeNotFound => NotFound("One or more property types could not be found"), + ContentEditingOperationStatus.PropertyTypeNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("One or more property types could not be found") + .Build()), ContentEditingOperationStatus.InTrash => BadRequest(new ProblemDetailsBuilder() .WithTitle("Content is in the recycle bin") .WithDetail("Could not perform the operation because the targeted content was in the recycle bin.") .Build()), - ContentEditingOperationStatus.Unknown => StatusCode(StatusCodes.Status500InternalServerError, "Unknown error. Please see the log for more details."), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown content operation status.") + ContentEditingOperationStatus.Unknown => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown error. Please see the log for more details.") + .Build()), + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown content operation status.") + .Build()), }; protected IActionResult ContentCreatingOperationStatusResult(ContentCreatingOperationStatus status) => status switch { - ContentCreatingOperationStatus.NotFound => NotFound("The content type could not be found"), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown content operation status."), + ContentCreatingOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The content type could not be found") + .Build()), + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown content operation status.") + .Build()), }; protected IActionResult PublicAccessOperationStatusResult(PublicAccessOperationStatus status) => status switch { - PublicAccessOperationStatus.ContentNotFound => NotFound("The content could not be found"), - PublicAccessOperationStatus.ErrorNodeNotFound => NotFound("The error page could not be found"), - PublicAccessOperationStatus.LoginNodeNotFound => NotFound("The login page could not be found"), + PublicAccessOperationStatus.ContentNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The content could not be found") + .Build()), + PublicAccessOperationStatus.ErrorNodeNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The error page could not be found") + .Build()), + PublicAccessOperationStatus.LoginNodeNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The login page could not be found") + .Build()), PublicAccessOperationStatus.NoAllowedEntities => BadRequest(new ProblemDetailsBuilder() .WithTitle("No allowed entities given") .WithDetail("Both MemberGroups and Members were empty, thus no entities can be allowed.") @@ -69,6 +93,8 @@ public class ContentControllerBase : ManagementApiControllerBase .WithTitle("Ambiguous Rule") .WithDetail("The specified rule is ambiguous, because both member groups and member names were given.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown content operation status."), + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown content operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/ByKeyDataTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/ByKeyDataTypeController.cs index f79eceb4e8..6c4842ff3e 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/ByKeyDataTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/ByKeyDataTypeController.cs @@ -23,13 +23,13 @@ public class ByKeyDataTypeController : DataTypeControllerBase [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(DataTypeResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task> ByKey(Guid id) + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task ByKey(Guid id) { IDataType? dataType = await _dataTypeService.GetAsync(id); if (dataType == null) { - return NotFound(); + return DataTypeNotFound(); } return Ok(_umbracoMapper.Map(dataType)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/CopyDataTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/CopyDataTypeController.cs index c28913abf7..a107c5138f 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/CopyDataTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/CopyDataTypeController.cs @@ -25,13 +25,13 @@ public class CopyDataTypeController : DataTypeControllerBase [HttpPost("{id:guid}/copy")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status201Created)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Copy(Guid id, CopyDataTypeRequestModel copyDataTypeRequestModel) { IDataType? source = await _dataTypeService.GetAsync(id); if (source is null) { - return NotFound(); + return DataTypeNotFound(); } Attempt result = await _dataTypeService.CopyAsync(source, copyDataTypeRequestModel.TargetId, CurrentUserKey(_backOfficeSecurityAccessor)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/CreateDataTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/CreateDataTypeController.cs index c595472a49..7658fa64b4 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/CreateDataTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/CreateDataTypeController.cs @@ -29,7 +29,7 @@ public class CreateDataTypeController : DataTypeControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status201Created)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Create(CreateDataTypeRequestModel createDataTypeRequestModel) { var attempt = await _dataTypePresentationFactory.CreateAsync(createDataTypeRequestModel); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/DataTypeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/DataTypeControllerBase.cs index 64316f8cb7..21de9519ea 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/DataTypeControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/DataTypeControllerBase.cs @@ -39,10 +39,19 @@ public abstract class DataTypeControllerBase : ManagementApiControllerBase .WithTitle("Cancelled by notification") .WithDetail("A notification handler prevented the data type operation.") .Build()), - DataTypeOperationStatus.PropertyEditorNotFound => NotFound("The targeted property editor was not found."), - DataTypeOperationStatus.ParentNotFound => NotFound("The targeted parent for the data type operation was not found."), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown data type operation status") + DataTypeOperationStatus.PropertyEditorNotFound => NotFound( + new ProblemDetailsBuilder() + .WithTitle("The targeted property editor was not found.") + .Build()), + DataTypeOperationStatus.ParentNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The targeted parent for the data type operation was not found.") + .Build()), + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown data type operation status.") + .Build()), }; - protected IActionResult DataTypeNotFound() => NotFound("The data type could not be found"); + protected IActionResult DataTypeNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The data type could not be found") + .Build()); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/DeleteDataTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/DeleteDataTypeController.cs index 777ed85437..ee55587af8 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/DeleteDataTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/DeleteDataTypeController.cs @@ -25,7 +25,7 @@ public class DeleteDataTypeController : DataTypeControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Delete(Guid id) { Attempt result = await _dataTypeService.DeleteAsync(id, CurrentUserKey(_backOfficeSecurityAccessor)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/ByKeyDataTypeFolderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/ByKeyDataTypeFolderController.cs index c3cf091026..085a9b8480 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/ByKeyDataTypeFolderController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/ByKeyDataTypeFolderController.cs @@ -18,6 +18,6 @@ public class ByKeyDataTypeFolderController : DataTypeFolderControllerBase [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(FolderResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task ByKey(Guid id) => await GetFolderAsync(id); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/DataTypeFolderControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/DataTypeFolderControllerBase.cs index d391aab4ee..bb4e0703de 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/DataTypeFolderControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/DataTypeFolderControllerBase.cs @@ -44,8 +44,12 @@ public abstract class DataTypeFolderControllerBase : FolderManagementControllerB protected override IActionResult OperationStatusResult(DataTypeContainerOperationStatus status) => status switch { - DataTypeContainerOperationStatus.NotFound => NotFound("The data type folder could not be found"), - DataTypeContainerOperationStatus.ParentNotFound => NotFound("The data type parent folder could not be found"), + DataTypeContainerOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The data type folder could not be found") + .Build()), + DataTypeContainerOperationStatus.ParentNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The data type parent folder could not be found") + .Build()), DataTypeContainerOperationStatus.DuplicateName => BadRequest(new ProblemDetailsBuilder() .WithTitle("The name is already used") .WithDetail("The data type folder name must be unique on this parent.") @@ -62,6 +66,8 @@ public abstract class DataTypeFolderControllerBase : FolderManagementControllerB .WithTitle("Cancelled by notification") .WithDetail("A notification handler prevented the data type folder operation.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown data type folder operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown data type folder operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/DeleteDataTypeFolderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/DeleteDataTypeFolderController.cs index 59da3f56bb..b5fb35acfd 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/DeleteDataTypeFolderController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/DeleteDataTypeFolderController.cs @@ -17,6 +17,6 @@ public class DeleteDataTypeFolderController : DataTypeFolderControllerBase [HttpDelete("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Delete(Guid id) => await DeleteFolderAsync(id); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/UpdateDataTypeFolderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/UpdateDataTypeFolderController.cs index 3df3c580ee..0524fdec3d 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/UpdateDataTypeFolderController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Folder/UpdateDataTypeFolderController.cs @@ -18,6 +18,6 @@ public class UpdateDataTypeFolderController : DataTypeFolderControllerBase [HttpPut("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Update(Guid id, UpdateFolderReponseModel updateFolderReponseModel) => await UpdateFolderAsync(id, updateFolderReponseModel); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/IsUsedDataTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/IsUsedDataTypeController.cs index 55515fbb36..fa51377904 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/IsUsedDataTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/IsUsedDataTypeController.cs @@ -20,7 +20,7 @@ public class IsUsedDataTypeController : DataTypeControllerBase [HttpGet("{id:guid}/is-used")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(bool), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task IsUsed(Guid id) { Attempt result = await _dataTypeUsageService.HasSavedValuesAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/MoveDataTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/MoveDataTypeController.cs index 2899c30293..331a3120f2 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/MoveDataTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/MoveDataTypeController.cs @@ -25,13 +25,13 @@ public class MoveDataTypeController : DataTypeControllerBase [HttpPost("{id:guid}/move")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Move(Guid id, MoveDataTypeRequestModel moveDataTypeRequestModel) { IDataType? source = await _dataTypeService.GetAsync(id); if (source is null) { - return NotFound(); + return DataTypeNotFound(); } Attempt result = await _dataTypeService.MoveAsync(source, moveDataTypeRequestModel.TargetId, CurrentUserKey(_backOfficeSecurityAccessor)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/ReferencesDataTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/ReferencesDataTypeController.cs index 34d81a7bab..81cbe51303 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/ReferencesDataTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/ReferencesDataTypeController.cs @@ -24,7 +24,7 @@ public class ReferencesDataTypeController : DataTypeControllerBase [HttpGet("{id:guid}/references")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(DataTypeReferenceResponseModel[]), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task References(Guid id) { Attempt>, DataTypeOperationStatus> result = await _dataTypeService.GetReferencesAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/UpdateDataTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/UpdateDataTypeController.cs index 98cbdb1427..ecf7ffac5b 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/UpdateDataTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/UpdateDataTypeController.cs @@ -29,7 +29,7 @@ public class UpdateDataTypeController : DataTypeControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Update(Guid id, UpdateDataTypeRequestModel updateDataTypeViewModel) { IDataType? current = await _dataTypeService.GetAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ByKeyDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ByKeyDictionaryController.cs index aa535ddf20..aafb845373 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ByKeyDictionaryController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ByKeyDictionaryController.cs @@ -23,13 +23,13 @@ public class ByKeyDictionaryController : DictionaryControllerBase [HttpGet($"{{{nameof(id)}:guid}}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(DictionaryItemResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task> ByKey(Guid id) + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task ByKey(Guid id) { IDictionaryItem? dictionary = await _dictionaryItemService.GetAsync(id); if (dictionary == null) { - return NotFound(); + return DictionaryNotFound(); } return Ok(await _dictionaryPresentationFactory.CreateDictionaryItemViewModelAsync(dictionary)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/CreateDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/CreateDictionaryController.cs index 1aef960436..7a372b8748 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/CreateDictionaryController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/CreateDictionaryController.cs @@ -31,7 +31,7 @@ public class CreateDictionaryController : DictionaryControllerBase [HttpPost] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status201Created)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] public async Task Create(CreateDictionaryItemRequestModel createDictionaryItemRequestModel) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DeleteDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DeleteDictionaryController.cs index 35b4e0110f..34922245bd 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DeleteDictionaryController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DeleteDictionaryController.cs @@ -25,7 +25,7 @@ public class DeleteDictionaryController : DictionaryControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Delete(Guid id) { Attempt result = await _dictionaryItemService.DeleteAsync(id, CurrentUserKey(_backOfficeSecurityAccessor)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DictionaryControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DictionaryControllerBase.cs index 5d88a56b6a..e5aa553bd3 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DictionaryControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DictionaryControllerBase.cs @@ -21,8 +21,10 @@ public abstract class DictionaryControllerBase : ManagementApiControllerBase .WithTitle("Duplicate dictionary item name detected") .WithDetail("Another dictionary item exists with the same name. Dictionary item names must be unique.") .Build()), - DictionaryItemOperationStatus.ItemNotFound => NotFound("The dictionary item could not be found"), - DictionaryItemOperationStatus.ParentNotFound => NotFound("The dictionary item parent could not be found"), + DictionaryItemOperationStatus.ItemNotFound => DictionaryNotFound(), + DictionaryItemOperationStatus.ParentNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The dictionary item parent could not be found") + .Build()), DictionaryItemOperationStatus.CancelledByNotification => BadRequest(new ProblemDetailsBuilder() .WithTitle("Cancelled by notification") .WithDetail("A notification handler prevented the dictionary item operation.") @@ -31,6 +33,13 @@ public abstract class DictionaryControllerBase : ManagementApiControllerBase .WithTitle("Invalid parent") .WithDetail("The targeted parent dictionary item is not valid for this dictionary item operation.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown dictionary operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown dictionary operation status.") + .Build()), }; + + + protected IActionResult DictionaryNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The dictionary item could not be found") + .Build()); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ExportDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ExportDictionaryController.cs index 6f8116a829..54bd7933c3 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ExportDictionaryController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ExportDictionaryController.cs @@ -25,17 +25,17 @@ public class ExportDictionaryController : DictionaryControllerBase [HttpGet("{id:guid}/export")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Export(Guid id, bool includeChildren = false) { IDictionaryItem? dictionaryItem = await _dictionaryItemService.GetAsync(id); if (dictionaryItem is null) { - return await Task.FromResult(NotFound()); + return DictionaryNotFound(); } XElement xml = _entityXmlSerializer.Serialize(dictionaryItem, includeChildren); - return await Task.FromResult(File(Encoding.UTF8.GetBytes(xml.ToDataString()), MediaTypeNames.Application.Octet, $"{dictionaryItem.ItemKey}.udt")); + return File(Encoding.UTF8.GetBytes(xml.ToDataString()), MediaTypeNames.Application.Octet, $"{dictionaryItem.ItemKey}.udt"); } } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ImportDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ImportDictionaryController.cs index 3e0dfe1a09..463a431929 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ImportDictionaryController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ImportDictionaryController.cs @@ -29,7 +29,7 @@ public class ImportDictionaryController : DictionaryControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status201Created)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Import(ImportDictionaryRequestModel importDictionaryRequestModel) { Attempt result = await _dictionaryItemImportService @@ -41,8 +41,12 @@ public class ImportDictionaryController : DictionaryControllerBase return result.Status switch { DictionaryImportOperationStatus.Success => CreatedAtAction(controller => nameof(controller.ByKey), result.Result!.Key), - DictionaryImportOperationStatus.ParentNotFound => NotFound("The parent dictionary item could not be found."), - DictionaryImportOperationStatus.TemporaryFileNotFound => NotFound("The temporary file with specified id could not be found."), + DictionaryImportOperationStatus.ParentNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The parent dictionary item could not be found.") + .Build()), + DictionaryImportOperationStatus.TemporaryFileNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The temporary file with specified id could not be found.") + .Build()), DictionaryImportOperationStatus.InvalidFileType => BadRequest(new ProblemDetailsBuilder() .WithTitle("Invalid file type") .WithDetail("The dictionary import only supports UDT files.") @@ -51,7 +55,9 @@ public class ImportDictionaryController : DictionaryControllerBase .WithTitle("Invalid file content") .WithDetail("The uploaded file could not be read as a valid UDT file.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown dictionary import operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown dictionary import operation status.") + .Build()), }; } } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/MoveDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/MoveDictionaryController.cs index 60c3549fd7..ee089330cb 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/MoveDictionaryController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/MoveDictionaryController.cs @@ -26,13 +26,13 @@ public class MoveDictionaryController : DictionaryControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Move(Guid id, MoveDictionaryRequestModel moveDictionaryRequestModel) { IDictionaryItem? source = await _dictionaryItemService.GetAsync(id); if (source == null) { - return NotFound(); + return DictionaryNotFound(); } Attempt result = await _dictionaryItemService.MoveAsync( diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/UpdateDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/UpdateDictionaryController.cs index d563850052..b508b709f9 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/UpdateDictionaryController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/UpdateDictionaryController.cs @@ -32,13 +32,13 @@ public class UpdateDictionaryController : DictionaryControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Update(Guid id, UpdateDictionaryItemRequestModel updateDictionaryItemRequestModel) { IDictionaryItem? current = await _dictionaryItemService.GetAsync(id); if (current == null) { - return NotFound(); + return DictionaryNotFound(); } IDictionaryItem updated = await _dictionaryPresentationFactory.MapUpdateModelToDictionaryItemAsync(current, updateDictionaryItemRequestModel); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/AllowedChildrenByKeyDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/AllowedChildrenByKeyDocumentController.cs index 0bd273f279..bc5bd9efde 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/AllowedChildrenByKeyDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/AllowedChildrenByKeyDocumentController.cs @@ -28,7 +28,7 @@ public class AllowedChildrenByKeyDocumentController : DocumentControllerBase [HttpGet("{id:guid}/allowed-document-types")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task AllowedChildrenByKey(Guid id, int skip = 0, int take = 100) { Attempt?, ContentCreatingOperationStatus> allowedChildrenAttempt = await _contentCreatingService.GetAllowedChildrenContentTypesAsync(id, skip, take); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/AllowedChildrenOfRootDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/AllowedChildrenOfRootDocumentController.cs index eca4323bcd..09ec410f3f 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/AllowedChildrenOfRootDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/AllowedChildrenOfRootDocumentController.cs @@ -26,7 +26,7 @@ public class AllowedChildrenOfRootDocumentController : DocumentControllerBase [HttpGet("root/allowed-document-types")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task AllowedChildrenOfRoot(int skip = 0, int take = 100) { PagedModel allowedChildrenOfRoot = await _contentTypeService.GetAllAllowedAsRootAsync(skip, take); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs index 2768fa592b..711daa19c1 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/ByKeyDocumentController.cs @@ -23,7 +23,7 @@ public class ByKeyDocumentController : DocumentControllerBase [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(DocumentResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task ByKey(Guid id) { IContent? content = await _contentEditingService.GetAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/CopyDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/CopyDocumentController.cs index adf364eba5..0b7bbd0f90 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/CopyDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/CopyDocumentController.cs @@ -25,8 +25,8 @@ public class CopyDocumentController : DocumentControllerBase [HttpPost("{id:guid}/copy")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status201Created)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Copy(Guid id, CopyDocumentRequestModel copyDocumentRequestModel) { Attempt result = await _contentEditingService.CopyAsync( diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/CreateDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/CreateDocumentController.cs index 7157859b9a..378c79d9eb 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/CreateDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/CreateDocumentController.cs @@ -29,8 +29,8 @@ public class CreateDocumentController : DocumentControllerBase [HttpPost] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status201Created)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Create(CreateDocumentRequestModel requestModel) { ContentCreateModel model = _documentEditingPresentationFactory.MapCreateModel(requestModel); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/CreatePublicAccessDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/CreatePublicAccessDocumentController.cs index 4c1ca4cb90..743aa553d4 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/CreatePublicAccessDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/CreatePublicAccessDocumentController.cs @@ -26,8 +26,8 @@ public class CreatePublicAccessDocumentController : DocumentControllerBase [MapToApiVersion("1.0")] [HttpPost("{id:guid}/public-access")] [ProducesResponseType(StatusCodes.Status201Created)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Create(Guid id, PublicAccessRequestModel publicAccessRequestModel) { PublicAccessEntrySlim publicAccessEntrySlim = _publicAccessPresentationFactory.CreatePublicAccessEntrySlim(publicAccessRequestModel, id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/DeletePublicAccessDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/DeletePublicAccessDocumentController.cs index ffe6aa4de1..32aeb76bb6 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/DeletePublicAccessDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/DeletePublicAccessDocumentController.cs @@ -14,7 +14,7 @@ public class DeletePublicAccessDocumentController : DocumentControllerBase [MapToApiVersion("1.0")] [HttpDelete("{id:guid}/public-access")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Delete(Guid id) { await _publicAccessService.DeleteAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/DocumentControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/DocumentControllerBase.cs index 52958c2345..6c3b1dd98e 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/DocumentControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/DocumentControllerBase.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Umbraco.Cms.Api.Common.Builders; using Umbraco.Cms.Api.Management.Content; using Umbraco.Cms.Api.Management.Routing; using Umbraco.Cms.Core; @@ -13,5 +14,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.Document; [Authorize(Policy = "New" + AuthorizationPolicies.TreeAccessDocuments)] public abstract class DocumentControllerBase : ContentControllerBase { - protected IActionResult DocumentNotFound() => NotFound("The requested Document could not be found"); + protected IActionResult DocumentNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The requested Document could not be found") + .Build()); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/DomainsController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/DomainsController.cs index 3b51d9509a..98e797e784 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/DomainsController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/DomainsController.cs @@ -1,4 +1,5 @@ using Asp.Versioning; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Umbraco.Cms.Api.Management.ViewModels.Document; using Umbraco.Cms.Core.Mapping; @@ -21,6 +22,8 @@ public class DomainsController : DocumentControllerBase [MapToApiVersion("1.0")] [HttpGet("{id:guid}/domains")] + [ProducesResponseType(typeof(DomainsResponseModel), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task DomainsAsync(Guid id) { IDomain[] assignedDomains = (await _domainService.GetAssignedDomainsAsync(id, true)) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/GetPublicAccessDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/GetPublicAccessDocumentController.cs index ee34dfd522..32d86562b0 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/GetPublicAccessDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/GetPublicAccessDocumentController.cs @@ -1,4 +1,5 @@ using Asp.Versioning; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Umbraco.Cms.Api.Management.Factories; using Umbraco.Cms.Api.Management.ViewModels.PublicAccess; @@ -24,6 +25,7 @@ public class GetPublicAccessDocumentController : DocumentControllerBase [MapToApiVersion("1.0")] [HttpGet("{id:guid}/public-access")] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task GetPublicAccess(Guid id) { Attempt accessAttempt = diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/MoveDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/MoveDocumentController.cs index b558c55183..7cc05fee6e 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/MoveDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/MoveDocumentController.cs @@ -25,8 +25,8 @@ public class MoveDocumentController : DocumentControllerBase [HttpPut("{id:guid}/move")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Move(Guid id, MoveDocumentRequestModel moveDocumentRequestModel) { Attempt result = await _contentEditingService.MoveAsync( diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/MoveToRecycleBinDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/MoveToRecycleBinDocumentController.cs index f8e4822c2b..1243368986 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/MoveToRecycleBinDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/MoveToRecycleBinDocumentController.cs @@ -24,8 +24,8 @@ public class MoveToRecycleBinDocumentController : DocumentControllerBase [HttpDelete("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task MoveToRecycleBin(Guid id) { Attempt result = await _contentEditingService.MoveToRecycleBinAsync(id, CurrentUserKey(_backOfficeSecurityAccessor)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/NotificationsController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/NotificationsController.cs index 55c0463a44..9a46de5f1c 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/NotificationsController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/NotificationsController.cs @@ -23,7 +23,7 @@ public class NotificationsController : DocumentControllerBase [MapToApiVersion("1.0")] [HttpGet("{id:guid}/notifications")] [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Notifications(Guid id) { IContent? content = await _contentEditingService.GetAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDocumentController.cs index 240b1d7910..9113596482 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDocumentController.cs @@ -32,8 +32,8 @@ public class UpdateDocumentController : DocumentControllerBase [HttpPut("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Update(Guid id, UpdateDocumentRequestModel requestModel) { IContent? content = await _contentEditingService.GetAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDomainsController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDomainsController.cs index 8722a80fff..32cfb9427e 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDomainsController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDomainsController.cs @@ -39,7 +39,9 @@ public class UpdateDomainsController : DocumentControllerBase .WithTitle("Cancelled by notification") .WithDetail("A notification handler prevented the domain update operation.") .Build()), - DomainOperationStatus.ContentNotFound => NotFound("The targeted content item was not found."), + DomainOperationStatus.ContentNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The targeted content item was not found.") + .Build()), DomainOperationStatus.LanguageNotFound => BadRequest(new ProblemDetailsBuilder() .WithTitle("Invalid language specified") .WithDetail("One or more of the specified language ISO codes could not be found.") @@ -48,7 +50,9 @@ public class UpdateDomainsController : DocumentControllerBase .WithTitle("Duplicate domain name detected") .WithDetail("One or more of the specified domain names were duplicates, possibly of assignments to other content items.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown domain update operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown domain update operation status.") + .Build()), }; } } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateNotificationsController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateNotificationsController.cs index 3eb3ea4baf..78ec61cabe 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateNotificationsController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateNotificationsController.cs @@ -25,7 +25,7 @@ public class UpdateNotificationsController : DocumentControllerBase [MapToApiVersion("1.0")] [HttpPut("{id:guid}/notifications")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task UpdateNotifications(Guid id, UpdateDocumentNotificationsRequestModel updateModel) { IContent? content = await _contentEditingService.GetAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdatePublicAccessDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdatePublicAccessDocumentController.cs index 47e66d1eaf..42e96d8b40 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdatePublicAccessDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/UpdatePublicAccessDocumentController.cs @@ -26,8 +26,8 @@ public class UpdatePublicAccessDocumentController : DocumentControllerBase [HttpPut("{id:guid}/public-access")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Update(Guid id, PublicAccessRequestModel requestModel) { PublicAccessEntrySlim publicAccessEntrySlim = _publicAccessPresentationFactory.CreatePublicAccessEntrySlim(requestModel, id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ByKeyDocumentTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ByKeyDocumentTypeController.cs index 2f7b7cdd86..e1d8a7fd2a 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ByKeyDocumentTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ByKeyDocumentTypeController.cs @@ -23,14 +23,14 @@ public class ByKeyDocumentTypeController : DocumentTypeControllerBase [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(DocumentTypeResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task ByKey(Guid id) { // FIXME: create and use an async get method here. IContentType? contentType = _contentTypeService.Get(id); if (contentType == null) { - return NotFound(); + return DocumentTypeNotFound(); } DocumentTypeResponseModel model = _umbracoMapper.Map(contentType)!; diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/CreateDocumentTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/CreateDocumentTypeController.cs index ef7b762514..f5d9709499 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/CreateDocumentTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/CreateDocumentTypeController.cs @@ -22,7 +22,7 @@ public class CreateDocumentTypeController : CreateUpdateDocumentTypeControllerBa [HttpPost] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Create(CreateDocumentTypeRequestModel requestModel) { // FIXME: support document type folders (and creation within folders) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/DeleteDocumentTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/DeleteDocumentTypeController.cs index d3deea799f..bcd13fb526 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/DeleteDocumentTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/DeleteDocumentTypeController.cs @@ -19,14 +19,14 @@ public class DeleteDocumentTypeController : DocumentTypeControllerBase [HttpDelete("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(DocumentTypeResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Delete(Guid id) { // FIXME: create and use an async get method here. IContentType? contentType = _contentTypeService.Get(id); if (contentType == null) { - return NotFound(); + return DocumentTypeNotFound(); } // FIXME: create overload that accepts user key diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/DocumentTypeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/DocumentTypeControllerBase.cs index a417132b45..1c2fbbc9a4 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/DocumentTypeControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/DocumentTypeControllerBase.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Umbraco.Cms.Api.Common.Builders; using Umbraco.Cms.Api.Management.Routing; using Umbraco.Cms.Core; using Umbraco.Cms.Web.Common.Authorization; @@ -12,4 +13,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.DocumentType; [Authorize(Policy = "New" + AuthorizationPolicies.TreeAccessDocumentTypes)] public abstract class DocumentTypeControllerBase : ManagementApiControllerBase { + protected IActionResult DocumentTypeNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The document type could not be found") + .Build()); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/UpdateDocumentTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/UpdateDocumentTypeController.cs index be9eef50ad..2886dfd615 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/UpdateDocumentTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/UpdateDocumentTypeController.cs @@ -21,8 +21,8 @@ public class UpdateDocumentTypeController : CreateUpdateDocumentTypeControllerBa [HttpPut("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Update(Guid id, UpdateDocumentTypeRequestModel requestModel) { if (requestModel.Compositions.Any()) @@ -33,7 +33,7 @@ public class UpdateDocumentTypeController : CreateUpdateDocumentTypeControllerBa IContentType? contentType = _contentTypeService.Get(id); if (contentType is null) { - return NotFound(); + return DocumentTypeNotFound(); } ContentTypeOperationStatus result = HandleRequest(contentType, requestModel); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/FolderManagementControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/FolderManagementControllerBase.cs index fe99a31643..b1bb79b2a1 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/FolderManagementControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/FolderManagementControllerBase.cs @@ -1,5 +1,6 @@ using System.Linq.Expressions; using Microsoft.AspNetCore.Mvc; +using Umbraco.Cms.Api.Common.Builders; using Umbraco.Cms.Api.Management.ViewModels.Folder; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; @@ -20,7 +21,9 @@ public abstract class FolderManagementControllerBase : ManagementApiCon EntityContainer? container = await GetContainerAsync(key); if (container == null) { - return NotFound($"Could not find the folder with id: {key}"); + return NotFound(new ProblemDetailsBuilder() + .WithTitle($"Could not find the folder with id: {key}") + .Build()); } EntityContainer? parentContainer = await GetParentContainerAsync(container); @@ -60,7 +63,9 @@ public abstract class FolderManagementControllerBase : ManagementApiCon EntityContainer? container = await GetContainerAsync(key); if (container == null) { - return NotFound($"Could not find the folder with key: {key}"); + return NotFound(new ProblemDetailsBuilder() + .WithTitle($"Could not find the folder with key: {key}") + .Build()); } container.Name = updateFolderReponseModel.Name; diff --git a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/ByNameHealthCheckGroupController.cs b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/ByNameHealthCheckGroupController.cs index d8e5706014..5a2b709534 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/ByNameHealthCheckGroupController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/ByNameHealthCheckGroupController.cs @@ -29,9 +29,9 @@ public class ByNameHealthCheckGroupController : HealthCheckGroupControllerBase /// The health check group or not found result. [HttpGet("{name}")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(HealthCheckGroupPresentationModel), StatusCodes.Status200OK)] - public async Task> ByName(string name) + public async Task ByName(string name) { IEnumerable> groups = _healthCheckGroupPresentationFactory .CreateGroupingFromHealthCheckCollection(); @@ -40,7 +40,7 @@ public class ByNameHealthCheckGroupController : HealthCheckGroupControllerBase if (group is null) { - return NotFound(); + return HealthCheckGroupNotFound(); } return await Task.FromResult(Ok(_umbracoMapper.Map(group))); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/CheckHealthCheckGroupController.cs b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/CheckHealthCheckGroupController.cs index f66107e679..e7ad2a2d5d 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/CheckHealthCheckGroupController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/CheckHealthCheckGroupController.cs @@ -23,9 +23,9 @@ public class CheckHealthCheckGroupController : HealthCheckGroupControllerBase /// The health check group or not found result. [HttpPost("{name}/check")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(HealthCheckGroupWithResultResponseModel), StatusCodes.Status200OK)] - public async Task> ByNameWithResult(string name) + public async Task ByNameWithResult(string name) { IEnumerable> groups = _healthCheckGroupPresentationFactory .CreateGroupingFromHealthCheckCollection(); @@ -34,7 +34,7 @@ public class CheckHealthCheckGroupController : HealthCheckGroupControllerBase if (group is null) { - return NotFound(); + return HealthCheckGroupNotFound(); } return await Task.FromResult(Ok(_healthCheckGroupPresentationFactory.CreateHealthCheckGroupWithResultViewModel(group))); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/HealthCheckGroupControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/HealthCheckGroupControllerBase.cs index 22bc4b8777..2eda4b7939 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/HealthCheckGroupControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/HealthCheckGroupControllerBase.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Umbraco.Cms.Api.Common.Builders; using Umbraco.Cms.Api.Management.Routing; using Umbraco.Cms.Web.Common.Authorization; using Constants = Umbraco.Cms.Core.Constants; @@ -12,4 +13,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.HealthCheck.Group; [Authorize(Policy = "New" + AuthorizationPolicies.SectionAccessSettings)] public abstract class HealthCheckGroupControllerBase : ManagementApiControllerBase { + protected IActionResult HealthCheckGroupNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The health check group could not be found") + .Build()); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/DetailsIndexerController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Indexer/DetailsIndexerController.cs index 335c034ce7..947cd439ff 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/DetailsIndexerController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Indexer/DetailsIndexerController.cs @@ -49,7 +49,7 @@ public class DetailsIndexerController : IndexerControllerBase Type = "Error", }; - return await Task.FromResult(BadRequest(invalidModelProblem)); + return await Task.FromResult(NotFound(invalidModelProblem)); } } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/RebuildIndexerController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Indexer/RebuildIndexerController.cs index 3418729ac3..ae8006df09 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/RebuildIndexerController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Indexer/RebuildIndexerController.cs @@ -33,6 +33,8 @@ public class RebuildIndexerController : IndexerControllerBase [HttpPost("{indexName}/rebuild")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] [ProducesResponseType(typeof(OkResult), StatusCodes.Status200OK)] public async Task Rebuild(string indexName) { @@ -46,7 +48,7 @@ public class RebuildIndexerController : IndexerControllerBase Type = "Error", }; - return await Task.FromResult(BadRequest(invalidModelProblem)); + return await Task.FromResult(NotFound(invalidModelProblem)); } if (!_indexingRebuilderService.CanRebuild(index.Name)) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Language/ByIsoCodeLanguageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Language/ByIsoCodeLanguageController.cs index f0b437348a..4a6a525bd2 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Language/ByIsoCodeLanguageController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Language/ByIsoCodeLanguageController.cs @@ -22,14 +22,14 @@ public class ByIsoCodeLanguageController : LanguageControllerBase [HttpGet($"{{{nameof(isoCode)}}}")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(LanguageResponseModel), StatusCodes.Status200OK)] - public async Task> ByIsoCode(string isoCode) + public async Task ByIsoCode(string isoCode) { ILanguage? language = await _languageService.GetAsync(isoCode); if (language == null) { - return NotFound(); + return LanguageNotFound(); } return Ok(_umbracoMapper.Map(language)!); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Language/CreateLanguageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Language/CreateLanguageController.cs index ed6715e777..fb7cb7d9d2 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Language/CreateLanguageController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Language/CreateLanguageController.cs @@ -33,7 +33,7 @@ public class CreateLanguageController : LanguageControllerBase [HttpPost] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status201Created)] public async Task Create(CreateLanguageRequestModel createLanguageRequestModel) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Language/LanguageControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Language/LanguageControllerBase.cs index ed48d6fe49..bf8d374c53 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Language/LanguageControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Language/LanguageControllerBase.cs @@ -18,7 +18,7 @@ public abstract class LanguageControllerBase : ManagementApiControllerBase .WithTitle("Invalid fallback language") .WithDetail("The fallback language could not be applied. This may be caused if the fallback language causes cyclic fallbacks.") .Build()), - LanguageOperationStatus.NotFound => NotFound("The language could not be found"), + LanguageOperationStatus.NotFound => LanguageNotFound(), LanguageOperationStatus.MissingDefault => BadRequest(new ProblemDetailsBuilder() .WithTitle("No default language") .WithDetail("The attempted operation would result in having no default language defined. This is not allowed.") @@ -39,6 +39,12 @@ public abstract class LanguageControllerBase : ManagementApiControllerBase .WithTitle("Cancelled by notification") .WithDetail("A notification handler prevented the language operation.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown language operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown language operation status.") + .Build()), }; + + protected IActionResult LanguageNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The language could not be found") + .Build()); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Language/UpdateLanguageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Language/UpdateLanguageController.cs index ab697ae16f..e040ee8a1d 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Language/UpdateLanguageController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Language/UpdateLanguageController.cs @@ -33,7 +33,7 @@ public class UpdateLanguageController : LanguageControllerBase [HttpPut($"{{{nameof(isoCode)}}}")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status200OK)] public async Task Update(string isoCode, UpdateLanguageRequestModel updateLanguageRequestModel) @@ -41,7 +41,7 @@ public class UpdateLanguageController : LanguageControllerBase ILanguage? current = await _languageService.GetAsync(isoCode); if (current is null) { - return NotFound(); + return LanguageNotFound(); } ILanguage updated = _umbracoMapper.Map(updateLanguageRequestModel, current); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/LogViewerControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/LogViewerControllerBase.cs index 9fd53c4db2..4d85aedcad 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/LogViewerControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/LogViewerControllerBase.cs @@ -17,7 +17,9 @@ public abstract class LogViewerControllerBase : ManagementApiControllerBase protected IActionResult LogViewerOperationStatusResult(LogViewerOperationStatus status) => status switch { - LogViewerOperationStatus.NotFoundLogSearch => NotFound("The log search could not be found"), + LogViewerOperationStatus.NotFoundLogSearch => NotFound(new ProblemDetailsBuilder() + .WithTitle("The log search could not be found") + .Build()), LogViewerOperationStatus.DuplicateLogSearch => BadRequest(new ProblemDetailsBuilder() .WithTitle("Duplicate log search name") .WithDetail("Another log search already exists with the attempted name.") @@ -26,6 +28,8 @@ public abstract class LogViewerControllerBase : ManagementApiControllerBase .WithTitle("Cancelled due to log file size") .WithDetail("The log file size for the requested date range prevented the operation.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown log viewer operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown log viewer operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/ByNameSavedSearchLogViewerController.cs b/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/ByNameSavedSearchLogViewerController.cs index 9119d48164..fcf9b80aac 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/ByNameSavedSearchLogViewerController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/ByNameSavedSearchLogViewerController.cs @@ -27,15 +27,15 @@ public class ByNameSavedSearchLogViewerController : SavedSearchLogViewerControll /// The saved log search or not found result. [HttpGet("{name}")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(SavedLogSearchResponseModel), StatusCodes.Status200OK)] - public async Task> ByName(string name) + public async Task ByName(string name) { ILogViewerQuery? savedLogQuery = await _logViewerService.GetSavedLogQueryByNameAsync(name); if (savedLogQuery is null) { - return NotFound(); + return SavedSearchNotFound(); } return Ok(_umbracoMapper.Map(savedLogQuery)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/DeleteSavedSearchLogViewerController.cs b/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/DeleteSavedSearchLogViewerController.cs index fdd4de945c..04f51af02d 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/DeleteSavedSearchLogViewerController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/DeleteSavedSearchLogViewerController.cs @@ -22,7 +22,7 @@ public class DeleteSavedSearchLogViewerController : SavedSearchLogViewerControll /// The result of the deletion. [HttpDelete("{name}")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status200OK)] public async Task Delete(string name) { diff --git a/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/SavedSearchLogViewerControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/SavedSearchLogViewerControllerBase.cs index ba39a9a463..163dd3d4ff 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/SavedSearchLogViewerControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/LogViewer/SavedSearch/SavedSearchLogViewerControllerBase.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using Umbraco.Cms.Api.Common.Builders; using Umbraco.Cms.Api.Management.Routing; namespace Umbraco.Cms.Api.Management.Controllers.LogViewer.SavedSearch; @@ -8,4 +9,8 @@ namespace Umbraco.Cms.Api.Management.Controllers.LogViewer.SavedSearch; [ApiExplorerSettings(GroupName = "Log Viewer")] public class SavedSearchLogViewerControllerBase : LogViewerControllerBase { + + protected IActionResult SavedSearchNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The saved search could not be found") + .Build()); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/ByKeyMediaController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/ByKeyMediaController.cs index 1d8d5f52ae..f9675bdf1f 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/ByKeyMediaController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Media/ByKeyMediaController.cs @@ -24,7 +24,7 @@ public class ByKeyMediaController : MediaControllerBase [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(DocumentResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task ByKey(Guid id) { IMedia? media = await _mediaEditingService.GetAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/CreateMediaController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/CreateMediaController.cs index 93339add5a..0b9247e653 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/CreateMediaController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Media/CreateMediaController.cs @@ -29,8 +29,8 @@ public class CreateMediaController : MediaControllerBase [HttpPost] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status201Created)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Create(CreateMediaRequestModel createRequestModel) { MediaCreateModel model = _mediaEditingPresentationFactory.MapCreateModel(createRequestModel); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/MediaControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/MediaControllerBase.cs index 4542e366a5..6e9d0de0a0 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/MediaControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Media/MediaControllerBase.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Umbraco.Cms.Api.Common.Builders; using Umbraco.Cms.Api.Management.Content; using Umbraco.Cms.Api.Management.Routing; using Umbraco.Cms.Core; @@ -13,5 +14,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.Media; [Authorize(Policy = "New" + AuthorizationPolicies.SectionAccessMedia)] public class MediaControllerBase : ContentControllerBase { - protected IActionResult MediaNotFound() => NotFound("The requested Media could not be found"); + protected IActionResult MediaNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The requested Media could not be found") + .Build()); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/MoveMediaController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/MoveMediaController.cs index 5f0e9a210a..edee3334c0 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/MoveMediaController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Media/MoveMediaController.cs @@ -25,8 +25,8 @@ public class MoveMediaController : MediaControllerBase [HttpPut("{id:guid}/move")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Move(Guid id, MoveMediaRequestModel moveDocumentRequestModel) { Attempt result = await _mediaEditingService.MoveAsync( diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/MoveToRecycleBinMediaController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/MoveToRecycleBinMediaController.cs index cba24e23da..c47c82b781 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/MoveToRecycleBinMediaController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Media/MoveToRecycleBinMediaController.cs @@ -24,8 +24,8 @@ public class MoveToRecycleBinMediaController : MediaControllerBase [HttpDelete("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task MoveToRecycleBin(Guid id) { Attempt result = await _mediaEditingService.MoveToRecycleBinAsync(id, CurrentUserKey(_backOfficeSecurityAccessor)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/UpdateMediaController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/UpdateMediaController.cs index b7f245d734..c74e41e235 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/UpdateMediaController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Media/UpdateMediaController.cs @@ -32,8 +32,8 @@ public class UpdateMediaController : MediaControllerBase [HttpPut("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Update(Guid id, UpdateMediaRequestModel updateRequestModel) { IMedia? media = await _mediaEditingService.GetAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/ByKeyMediaTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/MediaType/ByKeyMediaTypeController.cs index 5e7d4812e7..96821c9012 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/ByKeyMediaTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/MediaType/ByKeyMediaTypeController.cs @@ -23,14 +23,14 @@ public class ByKeyMediaTypeController : MediaTypeControllerBase [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(MediaTypeResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task ByKey(Guid id) { // FIXME: create and use an async get method here. IMediaType? mediaType = _mediaTypeService.Get(id); if (mediaType == null) { - return NotFound(); + return MediaTypeNotFound(); } MediaTypeResponseModel model = _umbracoMapper.Map(mediaType)!; diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/MediaTypeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/MediaType/MediaTypeControllerBase.cs index 17837f70f3..1484f7cde4 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/MediaTypeControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/MediaType/MediaTypeControllerBase.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Umbraco.Cms.Api.Common.Builders; using Umbraco.Cms.Api.Management.Routing; using Umbraco.Cms.Core; using Umbraco.Cms.Web.Common.Authorization; @@ -12,4 +13,9 @@ namespace Umbraco.Cms.Api.Management.Controllers.MediaType; [Authorize(Policy = "New" + AuthorizationPolicies.TreeAccessMediaTypes)] public abstract class MediaTypeControllerBase : ManagementApiControllerBase { + protected IActionResult MediaTypeNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The media type could not be found") + .Build()); + + } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/ByKeyCreatedPackageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/ByKeyCreatedPackageController.cs index 76c741e755..9f6bb47a00 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/ByKeyCreatedPackageController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/ByKeyCreatedPackageController.cs @@ -27,15 +27,15 @@ public class ByKeyCreatedPackageController : CreatedPackageControllerBase /// The package or not found result. [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(PackageDefinitionResponseModel), StatusCodes.Status200OK)] - public async Task> ByKey(Guid id) + public async Task ByKey(Guid id) { PackageDefinition? package = await _packagingService.GetCreatedPackageByKeyAsync(id); if (package is null) { - return NotFound(); + return CreatedPackageNotFound(); } return Ok(_umbracoMapper.Map(package)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/CreateCreatedPackageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/CreateCreatedPackageController.cs index af0689876f..2e09ddbcae 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/CreateCreatedPackageController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/CreateCreatedPackageController.cs @@ -35,7 +35,7 @@ public class CreateCreatedPackageController : CreatedPackageControllerBase /// The created package. [HttpPost] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status201Created)] public async Task Create(CreatePackageRequestModel createPackageRequestModel) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/CreatedPackageControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/CreatedPackageControllerBase.cs index 45e8967858..310842b9be 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/CreatedPackageControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/CreatedPackageControllerBase.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using Umbraco.Cms.Api.Common.Builders; using Umbraco.Cms.Api.Management.Routing; namespace Umbraco.Cms.Api.Management.Controllers.Package.Created; @@ -8,4 +9,13 @@ namespace Umbraco.Cms.Api.Management.Controllers.Package.Created; [ApiExplorerSettings(GroupName = "Package")] public class CreatedPackageControllerBase : PackageControllerBase { + protected IActionResult CreatedPackageNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The created package could not be found") + .Build()); + + protected IActionResult CreatedPackageFileStreamNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The created package file stream could not be found") + .Build()); + + } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/DeleteCreatedPackageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/DeleteCreatedPackageController.cs index f197a2d68c..faa7d2d146 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/DeleteCreatedPackageController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/DeleteCreatedPackageController.cs @@ -28,7 +28,7 @@ public class DeleteCreatedPackageController : CreatedPackageControllerBase /// The result of the deletion. [HttpDelete("{id:guid}")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status200OK)] public async Task Delete(Guid id) { diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/DownloadCreatedPackageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/DownloadCreatedPackageController.cs index 215c1fae5c..2476c02537 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/DownloadCreatedPackageController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/DownloadCreatedPackageController.cs @@ -24,7 +24,7 @@ public class DownloadCreatedPackageController : CreatedPackageControllerBase /// The XML or ZIP file of the package or not found result. [HttpGet("{id:guid}/download")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)] public async Task Download(Guid id) { @@ -32,13 +32,13 @@ public class DownloadCreatedPackageController : CreatedPackageControllerBase if (package is null) { - return NotFound(); + return CreatedPackageNotFound(); } Stream? fileStream = _packagingService.GetPackageFileStream(package); if (fileStream is null) { - return NotFound(); + return CreatedPackageFileStreamNotFound(); } var fileName = Path.GetFileName(package.PackagePath); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/UpdateCreatedPackageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/UpdateCreatedPackageController.cs index 39ea11b027..41bb904e4c 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/UpdateCreatedPackageController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Package/Created/UpdateCreatedPackageController.cs @@ -36,7 +36,7 @@ public class UpdateCreatedPackageController : CreatedPackageControllerBase /// The created package. [HttpPut("{id:guid}")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status200OK)] public async Task Update(Guid id, UpdatePackageRequestModel updatePackageRequestModel) { @@ -44,7 +44,7 @@ public class UpdateCreatedPackageController : CreatedPackageControllerBase if (package is null) { - return NotFound(); + return CreatedPackageNotFound(); } // Macros are not included! diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Package/PackageControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Package/PackageControllerBase.cs index a1f5073c14..c730840a3e 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Package/PackageControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Package/PackageControllerBase.cs @@ -17,7 +17,9 @@ public abstract class PackageControllerBase : ManagementApiControllerBase protected IActionResult PackageOperationStatusResult(PackageOperationStatus status) => status switch { - PackageOperationStatus.NotFound => NotFound("The package could not be found"), + PackageOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The package could not be found") + .Build()), PackageOperationStatus.DuplicateItemName => Conflict(new ProblemDetailsBuilder() .WithTitle("Duplicate package name") .WithDetail("Another package already exists with the attempted name.") @@ -26,17 +28,23 @@ public abstract class PackageControllerBase : ManagementApiControllerBase .WithTitle("Invalid package name") .WithDetail("The attempted package name does not represent a valid name for a package.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown package operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown package operation status.") + .Build()), }; protected IActionResult PackageMigrationOperationStatusResult(PackageMigrationOperationStatus status) => status switch { - PackageMigrationOperationStatus.NotFound => NotFound("No migration plans were found for that package"), + PackageMigrationOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("No migration plans were found for that package") + .Build()), PackageMigrationOperationStatus.CancelledByFailedMigration => Conflict(new ProblemDetailsBuilder() .WithTitle("Package migration failed") .WithDetail("Check log for full details about the failed migration.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown package migration operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown package migration operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Package/RunMigrationPackageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Package/RunMigrationPackageController.cs index 740fd351ad..360e3197e2 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Package/RunMigrationPackageController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Package/RunMigrationPackageController.cs @@ -22,7 +22,7 @@ public class RunMigrationPackageController : PackageControllerBase /// The result of running the package migrations. [HttpPost("{name}/run-migration")] [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)] [ProducesResponseType(StatusCodes.Status200OK)] public async Task RunMigrations(string name) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/ByPathPartialViewController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/ByPathPartialViewController.cs index c00eb46ecd..8e7476010b 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/ByPathPartialViewController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/ByPathPartialViewController.cs @@ -30,7 +30,7 @@ public class ByPathPartialViewController : PartialViewControllerBase IPartialView? partialView = await _partialViewService.GetAsync(path); return partialView is null - ? NotFound() + ? PartialViewNotFound() : Ok(_mapper.Map(partialView)); } } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/PartialViewFolderControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/PartialViewFolderControllerBase.cs index 25088bda40..8491eb1ef2 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/PartialViewFolderControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Folder/PartialViewFolderControllerBase.cs @@ -60,6 +60,8 @@ public class PartialViewFolderControllerBase : PathFolderManagementControllerBas .WithTitle("Invalid name") .WithDetail("The name specified is not a valid name.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown partial view folder operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown partial view folder operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/PartialViewControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/PartialViewControllerBase.cs index c8a017f59d..65a7e6748e 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/PartialViewControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/PartialViewControllerBase.cs @@ -39,10 +39,15 @@ public class PartialViewControllerBase : ManagementApiControllerBase .WithTitle("Invalid name") .WithDetail("The partial view name is invalid.") .Build()), - PartialViewOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder() - .WithTitle("Partial view not found") - .WithDetail("The partial view was not found.") + PartialViewOperationStatus.NotFound => PartialViewNotFound(), + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown partial view operation status.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown partial view operation status") }; + + protected IActionResult PartialViewNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("Partial view not found") + .WithDetail("The partial view was not found.") + .Build()); + } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Snippet/ByNameController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Snippet/ByNameController.cs index e7864bdef6..ffebf19866 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Snippet/ByNameController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Snippet/ByNameController.cs @@ -23,13 +23,14 @@ public class ByNameController : PartialViewControllerBase [HttpGet("snippet/{name}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(PartialViewSnippetResponseModel), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task GetByName(string name) { PartialViewSnippet? snippet = await _partialViewService.GetSnippetByNameAsync(name); if (snippet is null) { - return NotFound(); + return PartialViewNotFound(); } PartialViewSnippetResponseModel? viewModel = _umbracoMapper.Map(snippet); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PathFolderManagementControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/PathFolderManagementControllerBase.cs index 4597682227..291ed932f3 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/PathFolderManagementControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/PathFolderManagementControllerBase.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using Umbraco.Cms.Api.Common.Builders; using Umbraco.Cms.Api.Management.ViewModels.Folder; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Mapping; @@ -20,7 +21,9 @@ public abstract class PathFolderManagementControllerBase : ManagementAp PathContainer? container = await GetContainerAsync(path); if (container == null) { - return NotFound(); + return NotFound(new ProblemDetailsBuilder() + .WithTitle("The container could not be found") + .Build()); } PathFolderResponseModel? viewModel = Mapper.Map(container); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Profiling/ProfilingControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Profiling/ProfilingControllerBase.cs index f868c2a30e..c07bda5862 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Profiling/ProfilingControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Profiling/ProfilingControllerBase.cs @@ -23,6 +23,8 @@ public class ProfilingControllerBase : ManagementApiControllerBase .WithDetail("Executing this action requires a signed in user.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown profiling operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown profiling operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PropertyType/PropertyTypeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/PropertyType/PropertyTypeControllerBase.cs index dbf73d5269..0dfc238a2a 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/PropertyType/PropertyTypeControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/PropertyType/PropertyTypeControllerBase.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Umbraco.Cms.Api.Common.Builders; using Umbraco.Cms.Api.Management.Routing; using Umbraco.Cms.Core.Services.OperationStatus; using Umbraco.Cms.Web.Common.Authorization; @@ -16,7 +17,11 @@ public abstract class PropertyTypeControllerBase : ManagementApiControllerBase protected IActionResult PropertyTypeOperationStatusResult(PropertyTypeOperationStatus status) => status switch { - PropertyTypeOperationStatus.ContentTypeNotFound => NotFound("The content type was not found."), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown data type operation status") + PropertyTypeOperationStatus.ContentTypeNotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The content type was not found.") + .Build()), + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown property type operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByIdRelationController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByIdRelationController.cs index 4622d86160..1ad45a5912 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByIdRelationController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByIdRelationController.cs @@ -23,13 +23,13 @@ public class ByIdRelationController : RelationControllerBase [HttpGet("{id:int}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(RelationResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task ById(int id) + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task ById(int id) { IRelation? relation = _relationService.GetById(id); if (relation is null) { - return NotFound(); + return RelationNotFound(); } return await Task.FromResult(Ok(_relationPresentationFactory.Create(relation))); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByRelationTypeKeyRelationController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByRelationTypeKeyRelationController.cs index 94c97080dd..aaca170877 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByRelationTypeKeyRelationController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByRelationTypeKeyRelationController.cs @@ -26,6 +26,7 @@ public class ByRelationTypeKeyRelationController : RelationControllerBase [HttpGet("type/{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status404NotFound)] public async Task ByRelationTypeKey(Guid id, int skip = 0, int take = 100) { Attempt, RelationOperationStatus> relationsAttempt = await _relationService.GetPagedByRelationTypeKey(id, skip, take); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Relation/RelationControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Relation/RelationControllerBase.cs index 725854d64c..297bdf4ab3 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Relation/RelationControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Relation/RelationControllerBase.cs @@ -21,4 +21,9 @@ public abstract class RelationControllerBase : ManagementApiControllerBase .WithDetail("The relation type could not be found.") .Build()), }; + + protected IActionResult RelationNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The relation could not be found") + .Build()); + } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Query/ByKeyRelationTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Query/ByKeyRelationTypeController.cs index 06fb21509d..73b6060a71 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Query/ByKeyRelationTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Query/ByKeyRelationTypeController.cs @@ -23,13 +23,13 @@ public class ByKeyRelationTypeController : RelationTypeControllerBase [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(RelationTypeResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task ByKey(Guid id) { IRelationType? relationType = _relationService.GetRelationTypeById(id); if (relationType is null) { - return NotFound(); + return RelationTypeNotFound(); } RelationTypeResponseModel mappedRelationType = _mapper.Map(relationType)!; diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Query/RelationTypeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Query/RelationTypeControllerBase.cs index ea3821a057..e0a56a09da 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Query/RelationTypeControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Query/RelationTypeControllerBase.cs @@ -29,10 +29,7 @@ public class RelationTypeControllerBase : ManagementApiControllerBase .WithTitle("Key already exists") .WithDetail("An entity with the given key already exists") .Build()), - RelationTypeOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder() - .WithTitle("Relation type not found") - .WithDetail("A relation type with the given key does not exist") - .Build()), + RelationTypeOperationStatus.NotFound => RelationTypeNotFound(), RelationTypeOperationStatus.InvalidChildObjectType => BadRequest(new ProblemDetailsBuilder() .WithTitle("Invalid child object type") .WithDetail("The child object type is not allowed") @@ -42,4 +39,10 @@ public class RelationTypeControllerBase : ManagementApiControllerBase .WithDetail("The parent object type is not allowed") .Build()), }; + + protected IActionResult RelationTypeNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("Relation type not found") + .WithDetail("A relation type with the given key does not exist") + .Build()); + } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/ByPathScriptController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/ByPathScriptController.cs index f788b3aaa8..611a92a3fa 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Script/ByPathScriptController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Script/ByPathScriptController.cs @@ -30,7 +30,7 @@ public class ByPathScriptController : ScriptControllerBase IScript? script = await _scriptService.GetAsync(path); return script is null - ? NotFound() + ? ScriptNotFound() : Ok(_mapper.Map(script)); } } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/ScriptFolderControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/ScriptFolderControllerBase.cs index 23cb60453f..9737fb4909 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/ScriptFolderControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Script/Folder/ScriptFolderControllerBase.cs @@ -60,6 +60,8 @@ public class ScriptFolderControllerBase : PathFolderManagementControllerBase StatusCode(StatusCodes.Status500InternalServerError, "Unknown script folder operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown script folder operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/ScriptControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/ScriptControllerBase.cs index 8701853603..9a7985cff7 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Script/ScriptControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Script/ScriptControllerBase.cs @@ -39,14 +39,19 @@ public class ScriptControllerBase : ManagementApiControllerBase .WithTitle("Path too long") .WithDetail("The file path is too long.") .Build()), - ScriptOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder() - .WithTitle("Script not found") - .WithDetail("The script was not found.") - .Build()), + ScriptOperationStatus.NotFound => ScriptNotFound(), ScriptOperationStatus.InvalidName => BadRequest(new ProblemDetailsBuilder() .WithTitle("Invalid name") .WithDetail("The script name is invalid.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown script operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown script operation status.") + .Build()), }; + + protected IActionResult ScriptNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The script could not be found") + .WithDetail("The script was not found.") + .Build()); + } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/ByPathStylesheetController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/ByPathStylesheetController.cs index 9d21b046d1..51a9f5475f 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/ByPathStylesheetController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/ByPathStylesheetController.cs @@ -31,7 +31,7 @@ public class ByPathStylesheetController : StylesheetControllerBase if (stylesheet is null) { - return NotFound(); + return StylesheetNotFound(); } StylesheetResponseModel? viewModel = _umbracoMapper.Map(stylesheet); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/StylesheetFolderControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/StylesheetFolderControllerBase.cs index 28f5700711..847d7154d5 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/StylesheetFolderControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Folder/StylesheetFolderControllerBase.cs @@ -59,6 +59,8 @@ public class StylesheetFolderControllerBase : PathFolderManagementControllerBase .WithTitle("Invalid name") .WithDetail("The name specified is not a valid name.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown stylesheet folder operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown stylesheet folder operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/StylesheetControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/StylesheetControllerBase.cs index 865519a20c..28066a8fda 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/StylesheetControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/StylesheetControllerBase.cs @@ -39,14 +39,18 @@ public class StylesheetControllerBase : ManagementApiControllerBase .WithTitle("Path too long") .WithDetail("The file path is too long.") .Build()), - StylesheetOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder() - .WithTitle("Stylesheet not found") - .WithDetail("The stylesheet was not found.") - .Build()), + StylesheetOperationStatus.NotFound => StylesheetNotFound(), StylesheetOperationStatus.InvalidName => BadRequest(new ProblemDetailsBuilder() .WithTitle("Invalid name") .WithDetail("The stylesheet name is invalid.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown script operation status"), + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown stylesheet operation status.") + .Build()), }; + + protected IActionResult StylesheetNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("Stylesheet not found") + .WithDetail("The stylesheet was not found.") + .Build()); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/ByKeyTemplateController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/ByKeyTemplateController.cs index a27aaefe88..ab55242fd1 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/ByKeyTemplateController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Template/ByKeyTemplateController.cs @@ -25,12 +25,12 @@ public class ByKeyTemplateController : TemplateControllerBase [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(TemplateResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task> ByKey(Guid id) + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task ByKey(Guid id) { ITemplate? template = await _templateService.GetAsync(id); return template == null - ? NotFound() + ? TemplateNotFound() : Ok(await _templatePresentationFactory.CreateTemplateResponseModelAsync(template)); } } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/CreateTemplateController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/CreateTemplateController.cs index d0070725f4..40c1a0ebfd 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/CreateTemplateController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Template/CreateTemplateController.cs @@ -28,7 +28,7 @@ public class CreateTemplateController : TemplateControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status201Created)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Create(CreateTemplateRequestModel requestModel) { Attempt result = await _templateService.CreateAsync( diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/DeleteTemplateController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/DeleteTemplateController.cs index 0af5b61aee..1a94bc812e 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/DeleteTemplateController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Template/DeleteTemplateController.cs @@ -25,7 +25,7 @@ public class DeleteTemplateController : TemplateControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Delete(Guid id) { Attempt result = await _templateService.DeleteAsync(id, CurrentUserKey(_backOfficeSecurityAccessor)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/ScaffoldTemplateController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/ScaffoldTemplateController.cs index 2b74089242..21cfb24207 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/ScaffoldTemplateController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Template/ScaffoldTemplateController.cs @@ -18,7 +18,7 @@ public class ScaffoldTemplateController : TemplateControllerBase [HttpGet("scaffold")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(TemplateScaffoldResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task> Scaffold([FromQuery(Name = "masterTemplateId")] Guid? masterTemplateId) { var scaffoldViewModel = new TemplateScaffoldResponseModel diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/TemplateControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/TemplateControllerBase.cs index 34651683aa..44a8ee7360 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/TemplateControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Template/TemplateControllerBase.cs @@ -18,7 +18,7 @@ public class TemplateControllerBase : ManagementApiControllerBase protected IActionResult TemplateOperationStatusResult(TemplateOperationStatus status) => status switch { - TemplateOperationStatus.TemplateNotFound => NotFound("The template could not be found"), + TemplateOperationStatus.TemplateNotFound => TemplateNotFound(), TemplateOperationStatus.InvalidAlias => BadRequest(new ProblemDetailsBuilder() .WithTitle("Invalid alias") .WithDetail("The template alias is not valid.") @@ -31,6 +31,13 @@ public class TemplateControllerBase : ManagementApiControllerBase .WithTitle("Duplicate alias") .WithDetail("A template with that alias already exists.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown template operation status") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown template operation status.") + .Build()), }; + + protected IActionResult TemplateNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The template could not be found") + .Build()); + } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/UpdateTemplateController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/UpdateTemplateController.cs index 664119e6be..e232377109 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/UpdateTemplateController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Template/UpdateTemplateController.cs @@ -32,13 +32,13 @@ public class UpdateTemplateController : TemplateControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Update(Guid id, UpdateTemplateRequestModel requestModel) { ITemplate? template = await _templateService.GetAsync(id); if (template == null) { - return NotFound(); + return TemplateNotFound(); } template = _umbracoMapper.Map(requestModel, template); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/ByKeyTemporaryFileController.cs b/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/ByKeyTemporaryFileController.cs index f06460b5bc..e612d8f1b9 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/ByKeyTemporaryFileController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/ByKeyTemporaryFileController.cs @@ -32,7 +32,7 @@ public class ByKeyTemporaryFileController : TemporaryFileControllerBase TemporaryFileModel? model = await _temporaryFileService.GetAsync(id); if (model == null) { - return NotFound(); + return TemporaryFileNotFound(); } return Ok(_umbracoMapper.Map(model)); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/TemporaryFileControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/TemporaryFileControllerBase.cs index b9b36169e2..4c4588d297 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/TemporaryFileControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/TemporaryFile/TemporaryFileControllerBase.cs @@ -24,10 +24,16 @@ public abstract class TemporaryFileControllerBase : ManagementApiControllerBase .WithDetail("The specified key is already used.") .Build()), - TemporaryFileOperationStatus.NotFound => NotFound(), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown temporary file operation status") + TemporaryFileOperationStatus.NotFound => NotFound(new ProblemDetailsBuilder() + .WithTitle("The temporary file was not found") + .Build()), + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown temporary file operation status.") + .Build()), }; - protected new IActionResult NotFound() => NotFound("The temporary file could not be found"); + protected IActionResult TemporaryFileNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The temporary file could not be found") + .Build()); } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Tour/TourControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Tour/TourControllerBase.cs index 79d9b1164e..54bc9a5c45 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Tour/TourControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Tour/TourControllerBase.cs @@ -19,6 +19,8 @@ public class TourControllerBase : ManagementApiControllerBase .WithTitle("User not found") .WithDetail("Was not able to find currently logged in user") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown tour operation status.") + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown tour operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/User/ByKeyUsersController.cs b/src/Umbraco.Cms.Api.Management/Controllers/User/ByKeyUsersController.cs index db5a620c40..1a372ea6d7 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/User/ByKeyUsersController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/User/ByKeyUsersController.cs @@ -26,7 +26,7 @@ public class ByKeyUserController : UserControllerBase [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(UserResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task ByKey(Guid id) { IUser? user = await _userService.GetAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/User/CreateInitialPasswordUserController.cs b/src/Umbraco.Cms.Api.Management/Controllers/User/CreateInitialPasswordUserController.cs index d94a567071..2385a9f680 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/User/CreateInitialPasswordUserController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/User/CreateInitialPasswordUserController.cs @@ -21,7 +21,7 @@ public class CreateInitialPasswordUserController : UserControllerBase [HttpPost("invite/create-password")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task CreateInitialPassword(CreateInitialPasswordUserRequestModel model) { Attempt response = await _userService.CreateInitialPasswordAsync(model.UserId, model.Token, model.Password); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/User/UsersControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/User/UsersControllerBase.cs index 31882604b1..6c1ce2d897 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/User/UsersControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/User/UsersControllerBase.cs @@ -19,7 +19,10 @@ public abstract class UserControllerBase : ManagementApiControllerBase status switch { UserOperationStatus.Success => Ok(), - UserOperationStatus.MissingUser => StatusCode(StatusCodes.Status500InternalServerError, "A performing user is required for the operation, but none was found."), + UserOperationStatus.MissingUser => + StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("A performing user is required for the operation, but none was found") + .Build()), UserOperationStatus.MissingUserGroup => NotFound(new ProblemDetailsBuilder() .WithTitle("Missing User Group") .WithDetail("The specified user group was not found.") @@ -49,7 +52,10 @@ public abstract class UserControllerBase : ManagementApiControllerBase .WithTitle("Cancelled by notification") .WithDetail("A notification handler prevented the user operation.") .Build()), - UserOperationStatus.CannotInvite => StatusCode(StatusCodes.Status500InternalServerError, "Cannot send user invitation."), + UserOperationStatus.CannotInvite => + StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Cannot send user invitation") + .Build()), UserOperationStatus.CannotDelete => BadRequest(new ProblemDetailsBuilder() .WithTitle("Cannot delete user") .WithDetail("The user cannot be deleted.") @@ -111,6 +117,8 @@ public abstract class UserControllerBase : ManagementApiControllerBase .WithDetail("The specified content node was not found.") .Build()), UserOperationStatus.Forbidden => Forbid(), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown user operation status."), + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown user operation status.") + .Build()), }; } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/User/VerifyInviteUsersController.cs b/src/Umbraco.Cms.Api.Management/Controllers/User/VerifyInviteUsersController.cs index c7ba7bc06b..5dff651a46 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/User/VerifyInviteUsersController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/User/VerifyInviteUsersController.cs @@ -20,7 +20,7 @@ public class VerifyInviteUserController : UserControllerBase [HttpPost("invite/verify")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Invite(VerifyInviteUserRequestModel model) { Attempt result = await _userService.VerifyInviteAsync(model.UserId, model.Token); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/ByKeyUserGroupController.cs b/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/ByKeyUserGroupController.cs index 471436309a..2b2c859cfd 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/ByKeyUserGroupController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/ByKeyUserGroupController.cs @@ -25,16 +25,16 @@ public class ByKeyUserGroupController : UserGroupControllerBase [HttpGet("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(UserGroupResponseModel), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task> ByKey(Guid id) + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] + public async Task ByKey(Guid id) { IUserGroup? userGroup = await _userGroupService.GetAsync(id); if (userGroup is null) { - return NotFound(); + return UserGroupNotFound(); } - return await _userGroupPresentationFactory.CreateAsync(userGroup); + return Ok(await _userGroupPresentationFactory.CreateAsync(userGroup)); } } diff --git a/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/DeleteUserGroupController.cs b/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/DeleteUserGroupController.cs index 1550d0c5b2..930655f391 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/DeleteUserGroupController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/DeleteUserGroupController.cs @@ -20,7 +20,7 @@ public class DeleteUserGroupController : UserGroupControllerBase [HttpDelete("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Delete(Guid id) { Attempt result = await _userGroupService.DeleteAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/UpdateUserGroupController.cs b/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/UpdateUserGroupController.cs index 726cce6609..e19dd29a98 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/UpdateUserGroupController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/UpdateUserGroupController.cs @@ -27,7 +27,7 @@ public class UpdateUserGroupController : UserGroupControllerBase [HttpPut("{id:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] public async Task Update(Guid id, UpdateUserGroupRequestModel dataTypeRequestModel) { IUserGroup? existingUserGroup = await _userGroupService.GetAsync(id); diff --git a/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/UserGroupsControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/UserGroupsControllerBase.cs index b3c7596c36..97f570d39e 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/UserGroupsControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/UserGroup/UserGroupsControllerBase.cs @@ -17,7 +17,7 @@ public class UserGroupControllerBase : ManagementApiControllerBase protected IActionResult UserGroupOperationStatusResult(UserGroupOperationStatus status) => status switch { - UserGroupOperationStatus.NotFound => NotFound("The user group could not be found"), + UserGroupOperationStatus.NotFound => UserGroupNotFound(), UserGroupOperationStatus.AlreadyExists => Conflict(new ProblemDetailsBuilder() .WithTitle("User group already exists") .WithDetail("The user group exists already.") @@ -78,6 +78,13 @@ public class UserGroupControllerBase : ManagementApiControllerBase .WithTitle("Missing user group name.") .WithDetail("The user group name is required, and cannot be an empty string.") .Build()), - _ => StatusCode(StatusCodes.Status500InternalServerError, "Unknown user group operation status."), + _ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder() + .WithTitle("Unknown user group operation status.") + .Build()), }; + + protected IActionResult UserGroupNotFound() => NotFound(new ProblemDetailsBuilder() + .WithTitle("The user group could not be found") + .Build()); + } diff --git a/src/Umbraco.Cms.Api.Management/OpenApi.json b/src/Umbraco.Cms.Api.Management/OpenApi.json index 0cf225697c..c423eb025a 100644 --- a/src/Umbraco.Cms.Api.Management/OpenApi.json +++ b/src/Umbraco.Cms.Api.Management/OpenApi.json @@ -353,7 +353,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -414,7 +431,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -464,7 +498,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -545,7 +596,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -618,7 +686,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -667,7 +752,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -730,7 +832,24 @@ "description": "Success" }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -800,7 +919,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -920,7 +1056,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -950,7 +1103,24 @@ "description": "Success" }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -1011,7 +1181,24 @@ "description": "Success" }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -1387,7 +1574,24 @@ } }, "404": { - "description": "Not Found" + "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", @@ -1488,7 +1692,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -1538,7 +1759,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -1619,7 +1857,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -1679,7 +1934,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -1762,7 +2034,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -1844,7 +2133,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -2208,8 +2514,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" + "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" + } + } + } } }, "security": [ @@ -2270,7 +2593,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -2329,7 +2669,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -2389,11 +2746,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -2658,11 +3029,25 @@ } } }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -2723,7 +3108,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -2752,11 +3154,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -2816,11 +3232,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -2887,7 +3317,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -2959,11 +3406,25 @@ } } }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -2992,7 +3453,56 @@ ], "responses": { "200": { - "description": "Success" + "description": "Success", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/DomainsResponseModel" + } + ] + } + }, + "text/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/DomainsResponseModel" + } + ] + } + }, + "text/plain": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/DomainsResponseModel" + } + ] + } + } + } + }, + "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" + } + } + } } }, "security": [ @@ -3112,11 +3622,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -3186,7 +3710,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -3247,7 +3788,24 @@ "description": "Success" }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -3319,11 +3877,25 @@ } } }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -3353,7 +3925,24 @@ "description": "Success" }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -3379,8 +3968,25 @@ } ], "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" + } + } + } } }, "security": [ @@ -3440,11 +4046,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -3587,7 +4207,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -3942,7 +4579,24 @@ ], "responses": { "404": { - "description": "Not Found" + "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" + } + } + } }, "200": { "description": "Success", @@ -4002,7 +4656,24 @@ ], "responses": { "404": { - "description": "Not Found" + "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" + } + } + } }, "200": { "description": "Success", @@ -4408,6 +5079,46 @@ } } }, + "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" + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, "200": { "description": "Success", "content": { @@ -4758,7 +5469,24 @@ }, "responses": { "404": { - "description": "Not Found" + "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", @@ -4819,7 +5547,24 @@ ], "responses": { "404": { - "description": "Not Found" + "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" + } + } + } }, "200": { "description": "Success", @@ -4974,7 +5719,24 @@ }, "responses": { "404": { - "description": "Not Found" + "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", @@ -5552,7 +6314,24 @@ ], "responses": { "404": { - "description": "Not Found" + "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" + } + } + } }, "200": { "description": "Success", @@ -5610,7 +6389,24 @@ ], "responses": { "404": { - "description": "Not Found" + "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" + } + } + } }, "200": { "description": "Success" @@ -5730,7 +6526,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -5995,11 +6808,25 @@ } } }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -6060,7 +6887,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -6089,11 +6933,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -6153,11 +7011,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -6219,11 +7091,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" - }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -7171,7 +8057,24 @@ ], "responses": { "404": { - "description": "Not Found" + "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" + } + } + } }, "409": { "description": "Conflict", @@ -7296,7 +8199,24 @@ }, "responses": { "404": { - "description": "Not Found" + "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", @@ -7358,7 +8278,24 @@ ], "responses": { "404": { - "description": "Not Found" + "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" + } + } + } }, "200": { "description": "Success", @@ -7417,7 +8354,24 @@ ], "responses": { "404": { - "description": "Not Found" + "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" + } + } + } }, "200": { "description": "Success" @@ -7478,7 +8432,24 @@ }, "responses": { "404": { - "description": "Not Found" + "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" + } + } + } }, "200": { "description": "Success" @@ -7510,7 +8481,24 @@ ], "responses": { "404": { - "description": "Not Found" + "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" + } + } + } }, "200": { "description": "Success", @@ -8110,6 +9098,26 @@ } } } + }, + "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" + } + } + } } }, "security": [ @@ -8866,7 +9874,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -9226,7 +10251,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -9363,6 +10405,26 @@ } } } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedProblemDetailsModel" + } + }, + "text/json": { + "schema": { + "$ref": "#/components/schemas/PagedProblemDetailsModel" + } + }, + "text/plain": { + "schema": { + "$ref": "#/components/schemas/PagedProblemDetailsModel" + } + } + } } }, "security": [ @@ -11422,7 +12484,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -11483,7 +12562,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -11533,7 +12629,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -11614,7 +12727,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -11869,7 +12999,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -12858,7 +14005,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -12888,7 +14052,24 @@ "description": "Success" }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -12949,7 +14130,24 @@ "description": "Success" }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -13240,7 +14438,24 @@ } }, "404": { - "description": "Not Found" + "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" + } + } + } } }, "security": [ @@ -14272,8 +15487,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" + "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" + } + } + } } } } @@ -14328,8 +15560,25 @@ "200": { "description": "Success" }, - "400": { - "description": "Bad Request" + "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" + } + } + } } } } @@ -17746,6 +18995,26 @@ }, "additionalProperties": false }, + "PagedProblemDetailsModel": { + "required": [ + "items", + "total" + ], + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "additionalProperties": false + }, "PagedRecycleBinItemResponseModel": { "required": [ "items", diff --git a/src/Umbraco.Web.UI.New.Client b/src/Umbraco.Web.UI.New.Client index 2f667994d3..9986c334f4 160000 --- a/src/Umbraco.Web.UI.New.Client +++ b/src/Umbraco.Web.UI.New.Client @@ -1 +1 @@ -Subproject commit 2f667994d357dfb94a4d866e1eadc61ef9c39261 +Subproject commit 9986c334f4f367eaa2a6739688aeb1dfb086f055