From 9092727d2ce36f8610811225971ba8e105c0f9ae Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Wed, 2 Apr 2025 09:14:42 +0200 Subject: [PATCH 1/5] Populate ancestor keys on document tree response items. --- .../Tree/DocumentTreeControllerBase.cs | 7 ++++++- .../Tree/DocumentTreeItemResponseModel.cs | 3 ++- src/Umbraco.Core/Services/EntityService.cs | 17 +++++++++++++++- src/Umbraco.Core/Services/IEntityService.cs | 7 +++++++ .../Services/EntityServiceTests.cs | 20 +++++++++++++++++++ 5 files changed, 51 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs index 33e451bdc5bf..19b4cd0bb598 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs @@ -33,7 +33,7 @@ protected DocumentTreeControllerBase( AppCaches appCaches, IBackOfficeSecurityAccessor backofficeSecurityAccessor, IDocumentPresentationFactory documentPresentationFactory) - : base(entityService, userStartNodeEntitiesService, dataTypeService) + : base(entityService, userStartNodeEntitiesService, dataTypeService) { _publicAccessService = publicAccessService; _appCaches = appCaches; @@ -52,6 +52,7 @@ protected override DocumentTreeItemResponseModel MapTreeItemViewModel(Guid? pare if (entity is IDocumentEntitySlim documentEntitySlim) { responseModel.IsProtected = _publicAccessService.IsProtected(entity.Path); + responseModel.AncestorIds = GetAncestorIds(EntityService.GetPathKeys(entity)); responseModel.IsTrashed = entity.Trashed; responseModel.Id = entity.Key; responseModel.CreateDate = entity.CreateDate; @@ -63,6 +64,10 @@ protected override DocumentTreeItemResponseModel MapTreeItemViewModel(Guid? pare return responseModel; } + private Guid[] GetAncestorIds(Guid[] keys) => + // Omit the last path key as that will be for the item itself. + keys.Take(keys.Length - 1).ToArray(); + protected override int[] GetUserStartNodeIds() => _backofficeSecurityAccessor .BackOfficeSecurity? diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemResponseModel.cs index 094522b91ab2..de110af2fb72 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemResponseModel.cs @@ -1,4 +1,3 @@ -using Umbraco.Cms.Api.Management.ViewModels.Content; using Umbraco.Cms.Api.Management.ViewModels.Document; using Umbraco.Cms.Api.Management.ViewModels.DocumentType; @@ -8,6 +7,8 @@ public class DocumentTreeItemResponseModel : ContentTreeItemResponseModel { public bool IsProtected { get; set; } + public Guid[] AncestorIds { get; set; } = []; + public DocumentTypeReferenceResponseModel DocumentType { get; set; } = new(); public IEnumerable Variants { get; set; } = Enumerable.Empty(); diff --git a/src/Umbraco.Core/Services/EntityService.cs b/src/Umbraco.Core/Services/EntityService.cs index 7f2ba473b7a1..34d10ce50e71 100644 --- a/src/Umbraco.Core/Services/EntityService.cs +++ b/src/Umbraco.Core/Services/EntityService.cs @@ -1,3 +1,4 @@ +using System.Globalization; using System.Linq.Expressions; using Microsoft.Extensions.Logging; using Umbraco.Cms.Core.Events; @@ -758,5 +759,19 @@ public IEnumerable GetPagedChildren( return _entityRepository.GetPagedResultsByQuery(query, objectTypeGuids, pageNumber, pageSize, out totalRecords, filter, ordering); } } -} + /// > + public Guid[] GetPathKeys(IEntitySlim entity) + { + var ids = entity.Path.Split(Constants.CharArrays.Comma, StringSplitOptions.RemoveEmptyEntries) + .Select(x => int.TryParse(x, NumberStyles.Integer, CultureInfo.InvariantCulture, out var val) ? val : -1) + .Where(x => x != -1) + .ToList(); + + return ids + .Select(x => _idKeyMap.GetKeyForId(x, UmbracoObjectTypes.Document)) + .Where(x => x.Success) + .Select(x => x.Result) + .ToArray(); + } +} diff --git a/src/Umbraco.Core/Services/IEntityService.cs b/src/Umbraco.Core/Services/IEntityService.cs index 08ff2feb8c46..243078326269 100644 --- a/src/Umbraco.Core/Services/IEntityService.cs +++ b/src/Umbraco.Core/Services/IEntityService.cs @@ -382,4 +382,11 @@ IEnumerable GetPagedDescendants( /// The identifier. /// When a new content or a media is saved with the key, it will have the reserved identifier. int ReserveId(Guid key); + + /// + /// Gets the GUID keys for an entity's path (provided as a comma separated list of integer Ids). + /// + /// The entity. + /// The path with each ID converted to a GUID. + Guid[] GetPathKeys(IEntitySlim entity) => []; } diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs index d18caf52b419..f168d57d63ec 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs @@ -870,6 +870,26 @@ public void ReserveId() Assert.IsFalse(EntityService.GetId(Guid.NewGuid(), UmbracoObjectTypes.DocumentType).Success); } + [Test] + public void EntityService_GetPathKeys_ReturnsExpectedKeys() + { + var contentType = ContentTypeService.Get("umbTextpage"); + + var root = ContentBuilder.CreateSimpleContent(contentType); + ContentService.Save(root); + + var child = ContentBuilder.CreateSimpleContent(contentType, Guid.NewGuid().ToString(), root); + ContentService.Save(child); + var grandChild = ContentBuilder.CreateSimpleContent(contentType, Guid.NewGuid().ToString(), child); + ContentService.Save(grandChild); + + var grandChildEntity = EntityService.Get(grandChild.Key); + Assert.IsNotNull(grandChildEntity); + + var result = EntityService.GetPathKeys(grandChildEntity); + Assert.AreEqual($"{root.Key},{child.Key},{grandChild.Key}", string.Join(",", result)); + } + private static bool _isSetup; private int _folderId; From 8609ce8e9728ce13e7d3b52791a7a1f7d0a37f96 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Wed, 2 Apr 2025 11:48:33 +0200 Subject: [PATCH 2/5] Populate ancestor keys on document collection response items. --- .../Document/Tree/DocumentTreeControllerBase.cs | 6 +----- .../DocumentCollectionPresentationFactory.cs | 17 ++++++++++++++++- .../Mapping/Document/DocumentMapDefinition.cs | 2 +- .../DocumentCollectionResponseModel.cs | 2 ++ src/Umbraco.Core/Services/EntityService.cs | 17 ++++++++++++----- src/Umbraco.Core/Services/IEntityService.cs | 3 ++- .../Services/EntityServiceTests.cs | 9 +++++---- 7 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs index 19b4cd0bb598..1506c067e5cc 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs @@ -52,7 +52,7 @@ protected override DocumentTreeItemResponseModel MapTreeItemViewModel(Guid? pare if (entity is IDocumentEntitySlim documentEntitySlim) { responseModel.IsProtected = _publicAccessService.IsProtected(entity.Path); - responseModel.AncestorIds = GetAncestorIds(EntityService.GetPathKeys(entity)); + responseModel.AncestorIds = EntityService.GetPathKeys(entity, omitSelf: true); responseModel.IsTrashed = entity.Trashed; responseModel.Id = entity.Key; responseModel.CreateDate = entity.CreateDate; @@ -64,10 +64,6 @@ protected override DocumentTreeItemResponseModel MapTreeItemViewModel(Guid? pare return responseModel; } - private Guid[] GetAncestorIds(Guid[] keys) => - // Omit the last path key as that will be for the item itself. - keys.Take(keys.Length - 1).ToArray(); - protected override int[] GetUserStartNodeIds() => _backofficeSecurityAccessor .BackOfficeSecurity? diff --git a/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs index 228952b46960..cf04d0ae98a0 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs @@ -1,5 +1,7 @@ +using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Api.Management.ViewModels.Document; using Umbraco.Cms.Api.Management.ViewModels.Document.Collection; +using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Mapping; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; @@ -9,11 +11,23 @@ namespace Umbraco.Cms.Api.Management.Factories; public class DocumentCollectionPresentationFactory : ContentCollectionPresentationFactory, IDocumentCollectionPresentationFactory { private readonly IPublicAccessService _publicAccessService; + private readonly IEntityService _entityService; + [Obsolete("Please use the non-obsolete constructor. Scheduled for removal in V17.")] public DocumentCollectionPresentationFactory(IUmbracoMapper mapper, IPublicAccessService publicAccessService) - : base(mapper) + : this( + mapper, + publicAccessService, + StaticServiceProvider.Instance.GetRequiredService()) + { + } + + [ActivatorUtilitiesConstructor] + public DocumentCollectionPresentationFactory(IUmbracoMapper mapper, IPublicAccessService publicAccessService, IEntityService entityService) + : base(mapper) { _publicAccessService = publicAccessService; + _entityService = entityService; } protected override Task SetUnmappedProperties(ListViewPagedModel contentCollection, List collectionResponseModels) @@ -27,6 +41,7 @@ protected override Task SetUnmappedProperties(ListViewPagedModel conte } item.IsProtected = _publicAccessService.IsProtected(matchingContentItem).Success; + item.AncestorIds = _entityService.GetPathKeys(matchingContentItem, omitSelf: true); } return Task.CompletedTask; diff --git a/src/Umbraco.Cms.Api.Management/Mapping/Document/DocumentMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/Document/DocumentMapDefinition.cs index dbc51a6f4197..0455c4515606 100644 --- a/src/Umbraco.Cms.Api.Management/Mapping/Document/DocumentMapDefinition.cs +++ b/src/Umbraco.Cms.Api.Management/Mapping/Document/DocumentMapDefinition.cs @@ -67,7 +67,7 @@ private void Map(IContent source, PublishedDocumentResponseModel target, MapperC target.IsTrashed = source.Trashed; } - // Umbraco.Code.MapAll -IsProtected + // Umbraco.Code.MapAll -IsProtected -AncestorIds private void Map(IContent source, DocumentCollectionResponseModel target, MapperContext context) { target.Id = source.Key; diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Document/Collection/DocumentCollectionResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Document/Collection/DocumentCollectionResponseModel.cs index a7c209ad2a20..7bd41c52089d 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Document/Collection/DocumentCollectionResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/Document/Collection/DocumentCollectionResponseModel.cs @@ -11,5 +11,7 @@ public class DocumentCollectionResponseModel : ContentCollectionResponseModelBas public bool IsProtected { get; set; } + public Guid[] AncestorIds { get; set; } = []; + public string? Updater { get; set; } } diff --git a/src/Umbraco.Core/Services/EntityService.cs b/src/Umbraco.Core/Services/EntityService.cs index 34d10ce50e71..f2fe2eefd871 100644 --- a/src/Umbraco.Core/Services/EntityService.cs +++ b/src/Umbraco.Core/Services/EntityService.cs @@ -761,17 +761,24 @@ public IEnumerable GetPagedChildren( } /// > - public Guid[] GetPathKeys(IEntitySlim entity) + public Guid[] GetPathKeys(ITreeEntity entity, bool omitSelf = false) { - var ids = entity.Path.Split(Constants.CharArrays.Comma, StringSplitOptions.RemoveEmptyEntries) + IEnumerable ids = entity.Path.Split(Constants.CharArrays.Comma, StringSplitOptions.RemoveEmptyEntries) .Select(x => int.TryParse(x, NumberStyles.Integer, CultureInfo.InvariantCulture, out var val) ? val : -1) - .Where(x => x != -1) - .ToList(); + .Where(x => x != -1); - return ids + Guid[] keys = ids .Select(x => _idKeyMap.GetKeyForId(x, UmbracoObjectTypes.Document)) .Where(x => x.Success) .Select(x => x.Result) .ToArray(); + + if (omitSelf) + { + // Omit the last path key as that will be for the item itself. + return keys.Take(keys.Length - 1).ToArray(); + } + + return keys; } } diff --git a/src/Umbraco.Core/Services/IEntityService.cs b/src/Umbraco.Core/Services/IEntityService.cs index 243078326269..964ec9f502b3 100644 --- a/src/Umbraco.Core/Services/IEntityService.cs +++ b/src/Umbraco.Core/Services/IEntityService.cs @@ -387,6 +387,7 @@ IEnumerable GetPagedDescendants( /// Gets the GUID keys for an entity's path (provided as a comma separated list of integer Ids). /// /// The entity. + /// A value indicating whether to omit the entity's own key from the result. /// The path with each ID converted to a GUID. - Guid[] GetPathKeys(IEntitySlim entity) => []; + Guid[] GetPathKeys(ITreeEntity entity, bool omitSelf = false) => []; } diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs index f168d57d63ec..0da6ba13d75f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs @@ -883,11 +883,12 @@ public void EntityService_GetPathKeys_ReturnsExpectedKeys() var grandChild = ContentBuilder.CreateSimpleContent(contentType, Guid.NewGuid().ToString(), child); ContentService.Save(grandChild); - var grandChildEntity = EntityService.Get(grandChild.Key); - Assert.IsNotNull(grandChildEntity); - - var result = EntityService.GetPathKeys(grandChildEntity); + var result = EntityService.GetPathKeys(grandChild); Assert.AreEqual($"{root.Key},{child.Key},{grandChild.Key}", string.Join(",", result)); + + var result2 = EntityService.GetPathKeys(grandChild, omitSelf: true); + Assert.AreEqual($"{root.Key},{child.Key}", string.Join(",", result2)); + } private static bool _isSetup; From 8e3a6de14619fbf0d464c7fcfbdf6cfdaef9c5de Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Wed, 2 Apr 2025 12:11:37 +0200 Subject: [PATCH 3/5] Update OpenApi.json --- src/Umbraco.Cms.Api.Management/OpenApi.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Umbraco.Cms.Api.Management/OpenApi.json b/src/Umbraco.Cms.Api.Management/OpenApi.json index 44a69ccc957e..065d43a1c4d6 100644 --- a/src/Umbraco.Cms.Api.Management/OpenApi.json +++ b/src/Umbraco.Cms.Api.Management/OpenApi.json @@ -37088,6 +37088,7 @@ }, "DocumentCollectionResponseModel": { "required": [ + "ancestorIds", "documentType", "id", "isProtected", @@ -37143,6 +37144,13 @@ "isProtected": { "type": "boolean" }, + "ancestorIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, "updater": { "type": "string", "nullable": true @@ -37456,6 +37464,7 @@ }, "DocumentTreeItemResponseModel": { "required": [ + "ancestorIds", "createDate", "documentType", "hasChildren", @@ -37495,6 +37504,13 @@ "isProtected": { "type": "boolean" }, + "ancestorIds": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, "documentType": { "oneOf": [ { From 38f392f528e278a3664e44fabe2ae6f199fbdfeb Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Thu, 3 Apr 2025 14:39:19 +0200 Subject: [PATCH 4/5] Use array of objects rather than Ids for the ancestor collection. --- .../Controllers/Document/Tree/DocumentTreeControllerBase.cs | 4 +++- .../Factories/DocumentCollectionPresentationFactory.cs | 4 +++- .../Mapping/Document/DocumentMapDefinition.cs | 2 +- .../Document/Collection/DocumentCollectionResponseModel.cs | 2 +- .../ViewModels/Tree/DocumentTreeItemResponseModel.cs | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs index 1506c067e5cc..cacf862b57bb 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs @@ -4,6 +4,7 @@ using Umbraco.Cms.Api.Management.Factories; using Umbraco.Cms.Api.Management.Routing; using Umbraco.Cms.Api.Management.Services.Entities; +using Umbraco.Cms.Api.Management.ViewModels; using Umbraco.Cms.Api.Management.ViewModels.Tree; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; @@ -52,7 +53,8 @@ protected override DocumentTreeItemResponseModel MapTreeItemViewModel(Guid? pare if (entity is IDocumentEntitySlim documentEntitySlim) { responseModel.IsProtected = _publicAccessService.IsProtected(entity.Path); - responseModel.AncestorIds = EntityService.GetPathKeys(entity, omitSelf: true); + responseModel.Ancestors = EntityService.GetPathKeys(entity, omitSelf: true) + .Select(x => new ReferenceByIdModel(x)); responseModel.IsTrashed = entity.Trashed; responseModel.Id = entity.Key; responseModel.CreateDate = entity.CreateDate; diff --git a/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs index cf04d0ae98a0..b63704cbb260 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/DocumentCollectionPresentationFactory.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.DependencyInjection; +using Umbraco.Cms.Api.Management.ViewModels; using Umbraco.Cms.Api.Management.ViewModels.Document; using Umbraco.Cms.Api.Management.ViewModels.Document.Collection; using Umbraco.Cms.Core.DependencyInjection; @@ -41,7 +42,8 @@ protected override Task SetUnmappedProperties(ListViewPagedModel conte } item.IsProtected = _publicAccessService.IsProtected(matchingContentItem).Success; - item.AncestorIds = _entityService.GetPathKeys(matchingContentItem, omitSelf: true); + item.Ancestors = _entityService.GetPathKeys(matchingContentItem, omitSelf: true) + .Select(x => new ReferenceByIdModel(x)); } return Task.CompletedTask; diff --git a/src/Umbraco.Cms.Api.Management/Mapping/Document/DocumentMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/Document/DocumentMapDefinition.cs index 0455c4515606..15eb6bafd8ec 100644 --- a/src/Umbraco.Cms.Api.Management/Mapping/Document/DocumentMapDefinition.cs +++ b/src/Umbraco.Cms.Api.Management/Mapping/Document/DocumentMapDefinition.cs @@ -67,7 +67,7 @@ private void Map(IContent source, PublishedDocumentResponseModel target, MapperC target.IsTrashed = source.Trashed; } - // Umbraco.Code.MapAll -IsProtected -AncestorIds + // Umbraco.Code.MapAll -IsProtected -Ancestors private void Map(IContent source, DocumentCollectionResponseModel target, MapperContext context) { target.Id = source.Key; diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Document/Collection/DocumentCollectionResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Document/Collection/DocumentCollectionResponseModel.cs index 7bd41c52089d..391714346a9f 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Document/Collection/DocumentCollectionResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/Document/Collection/DocumentCollectionResponseModel.cs @@ -11,7 +11,7 @@ public class DocumentCollectionResponseModel : ContentCollectionResponseModelBas public bool IsProtected { get; set; } - public Guid[] AncestorIds { get; set; } = []; + public IEnumerable Ancestors { get; set; } = []; public string? Updater { get; set; } } diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemResponseModel.cs index de110af2fb72..1bde7631025b 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemResponseModel.cs @@ -7,7 +7,7 @@ public class DocumentTreeItemResponseModel : ContentTreeItemResponseModel { public bool IsProtected { get; set; } - public Guid[] AncestorIds { get; set; } = []; + public IEnumerable Ancestors { get; set; } = []; public DocumentTypeReferenceResponseModel DocumentType { get; set; } = new(); From d8dfcbbb1bb6d1171acd59500354e6d8b503adb8 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Thu, 3 Apr 2025 14:41:22 +0200 Subject: [PATCH 5/5] Update OpenApi.json. --- src/Umbraco.Cms.Api.Management/OpenApi.json | 22 +++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/OpenApi.json b/src/Umbraco.Cms.Api.Management/OpenApi.json index 065d43a1c4d6..665c1f05d507 100644 --- a/src/Umbraco.Cms.Api.Management/OpenApi.json +++ b/src/Umbraco.Cms.Api.Management/OpenApi.json @@ -37088,7 +37088,7 @@ }, "DocumentCollectionResponseModel": { "required": [ - "ancestorIds", + "ancestors", "documentType", "id", "isProtected", @@ -37144,11 +37144,14 @@ "isProtected": { "type": "boolean" }, - "ancestorIds": { + "ancestors": { "type": "array", "items": { - "type": "string", - "format": "uuid" + "oneOf": [ + { + "$ref": "#/components/schemas/ReferenceByIdModel" + } + ] } }, "updater": { @@ -37464,7 +37467,7 @@ }, "DocumentTreeItemResponseModel": { "required": [ - "ancestorIds", + "ancestors", "createDate", "documentType", "hasChildren", @@ -37504,11 +37507,14 @@ "isProtected": { "type": "boolean" }, - "ancestorIds": { + "ancestors": { "type": "array", "items": { - "type": "string", - "format": "uuid" + "oneOf": [ + { + "$ref": "#/components/schemas/ReferenceByIdModel" + } + ] } }, "documentType": {