Merge branch 'contrib' into v12/dev
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models.DeliveryApi;
|
||||
|
||||
public class ApiElement : IApiElement
|
||||
@@ -11,6 +13,9 @@ public class ApiElement : IApiElement
|
||||
|
||||
public Guid Id { get; }
|
||||
|
||||
// Ensure the ContentType property is serialized first
|
||||
// This is needed so it can be used as a discriminator field by System.Text.Json
|
||||
[JsonPropertyOrder(-100)]
|
||||
public string ContentType { get; }
|
||||
|
||||
public IDictionary<string, object?> Properties { get; }
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models.DeliveryApi;
|
||||
|
||||
public interface IApiElement
|
||||
{
|
||||
Guid Id { get; }
|
||||
|
||||
// Ensure the ContentType property is serialized first
|
||||
// This is needed so it can be used as a discriminator field by System.Text.Json
|
||||
[JsonPropertyOrder(-100)]
|
||||
string ContentType { get; }
|
||||
|
||||
IDictionary<string, object?> Properties { get; }
|
||||
|
||||
@@ -113,7 +113,7 @@ public class BlockListPropertyValueConverter : BlockPropertyValueConverterBase<B
|
||||
|
||||
/// <inheritdoc />
|
||||
public Type GetDeliveryApiPropertyValueType(IPublishedPropertyType propertyType)
|
||||
=> typeof(IEnumerable<ApiBlockListModel>);
|
||||
=> typeof(ApiBlockListModel);
|
||||
|
||||
/// <inheritdoc />
|
||||
public object? ConvertIntermediateToDeliveryApiObject(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object? inter, bool preview, bool expanding)
|
||||
|
||||
Reference in New Issue
Block a user