Enrich the datatype references output with content type data (#16417)
This commit is contained in:
@@ -47,8 +47,13 @@ public class DataTypeReferencePresentationFactory : IDataTypeReferencePresentati
|
||||
IEnumerable<string> propertyAliases = propertyAliasesByGuid[contentType.Key];
|
||||
yield return new DataTypeReferenceResponseModel
|
||||
{
|
||||
Id = contentType.Key,
|
||||
Type = usagesByEntityType.Key,
|
||||
ContentType = new DataTypeContentTypeReferenceModel
|
||||
{
|
||||
Id = contentType.Key,
|
||||
Name = contentType.Name,
|
||||
Icon = contentType.Icon,
|
||||
Type = usagesByEntityType.Key,
|
||||
},
|
||||
Properties = contentType
|
||||
.PropertyTypes
|
||||
.Where(propertyType => propertyAliases.InvariantContains(propertyType.Alias))
|
||||
|
||||
@@ -35399,6 +35399,34 @@
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"DataTypeContentTypeReferenceModel": {
|
||||
"required": [
|
||||
"icon",
|
||||
"id",
|
||||
"name",
|
||||
"type"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"icon": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"DataTypeItemResponseModel": {
|
||||
"required": [
|
||||
"id",
|
||||
@@ -35457,18 +35485,17 @@
|
||||
},
|
||||
"DataTypeReferenceResponseModel": {
|
||||
"required": [
|
||||
"id",
|
||||
"properties",
|
||||
"type"
|
||||
"contentType",
|
||||
"properties"
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
"contentType": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/DataTypeContentTypeReferenceModel"
|
||||
}
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"type": "array",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Umbraco.Cms.Api.Management.ViewModels.DataType;
|
||||
|
||||
public class DataTypeContentTypeReferenceModel
|
||||
{
|
||||
public required Guid Id { get; set; }
|
||||
|
||||
public required string? Type { get; set; }
|
||||
|
||||
public required string? Name { get; set; }
|
||||
|
||||
public required string? Icon { get; set; }
|
||||
}
|
||||
@@ -2,9 +2,7 @@
|
||||
|
||||
public class DataTypeReferenceResponseModel
|
||||
{
|
||||
public required Guid Id { get; init; }
|
||||
|
||||
public required string Type { get; init; }
|
||||
public required DataTypeContentTypeReferenceModel ContentType { get; init; }
|
||||
|
||||
public required IEnumerable<DataTypePropertyReferenceViewModel> Properties { get; init; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user