Skip to content

Commit 715ceeb

Browse files
AndyButlandCopilotnikolajlauridsen
authored andcommitted
Updated management API endpoint and model for data type references to align with that used for documents, media etc. (#18905)
* Updated management API endpoint and model for data type references to align with that used for documents, media etc. * Refactoring. * Update src/Umbraco.Core/Constants-ReferenceTypes.cs Co-authored-by: Copilot <[email protected]> * Fixed typos. * Added id to tracked reference content type response. * Updated OpenApi.json. * Added missing updates. * Renamed model and constants from code review feedback. * Fix typo * Fix multiple enumeration --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: mole <[email protected]>
1 parent 5d58913 commit 715ceeb

File tree

2 files changed

+118
-1
lines changed

2 files changed

+118
-1
lines changed

src/Umbraco.Cms.Api.Management/OpenApi.json

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37832,6 +37832,45 @@
3783237832
},
3783337833
"additionalProperties": false
3783437834
},
37835+
"DocumentTypePropertyReferenceResponseModel": {
37836+
"required": [
37837+
"$type",
37838+
"documentType",
37839+
"id"
37840+
],
37841+
"type": "object",
37842+
"properties": {
37843+
"$type": {
37844+
"type": "string"
37845+
},
37846+
"id": {
37847+
"type": "string",
37848+
"format": "uuid"
37849+
},
37850+
"name": {
37851+
"type": "string",
37852+
"nullable": true
37853+
},
37854+
"alias": {
37855+
"type": "string",
37856+
"nullable": true
37857+
},
37858+
"documentType": {
37859+
"oneOf": [
37860+
{
37861+
"$ref": "#/components/schemas/TrackedReferenceDocumentTypeModel"
37862+
}
37863+
]
37864+
}
37865+
},
37866+
"additionalProperties": false,
37867+
"discriminator": {
37868+
"propertyName": "$type",
37869+
"mapping": {
37870+
"DocumentTypePropertyReferenceResponseModel": "#/components/schemas/DocumentTypePropertyReferenceResponseModel"
37871+
}
37872+
}
37873+
},
3783537874
"DocumentTypePropertyTypeContainerResponseModel": {
3783637875
"required": [
3783737876
"id",
@@ -39926,6 +39965,45 @@
3992639965
},
3992739966
"additionalProperties": false
3992839967
},
39968+
"MediaTypePropertyReferenceResponseModel": {
39969+
"required": [
39970+
"$type",
39971+
"id",
39972+
"mediaType"
39973+
],
39974+
"type": "object",
39975+
"properties": {
39976+
"$type": {
39977+
"type": "string"
39978+
},
39979+
"id": {
39980+
"type": "string",
39981+
"format": "uuid"
39982+
},
39983+
"name": {
39984+
"type": "string",
39985+
"nullable": true
39986+
},
39987+
"alias": {
39988+
"type": "string",
39989+
"nullable": true
39990+
},
39991+
"mediaType": {
39992+
"oneOf": [
39993+
{
39994+
"$ref": "#/components/schemas/TrackedReferenceMediaTypeModel"
39995+
}
39996+
]
39997+
}
39998+
},
39999+
"additionalProperties": false,
40000+
"discriminator": {
40001+
"propertyName": "$type",
40002+
"mapping": {
40003+
"MediaTypePropertyReferenceResponseModel": "#/components/schemas/MediaTypePropertyReferenceResponseModel"
40004+
}
40005+
}
40006+
},
3992940007
"MediaTypePropertyTypeContainerResponseModel": {
3993040008
"required": [
3993140009
"id",
@@ -40730,6 +40808,45 @@
4073040808
},
4073140809
"additionalProperties": false
4073240810
},
40811+
"MemberTypePropertyReferenceResponseModel": {
40812+
"required": [
40813+
"$type",
40814+
"id",
40815+
"memberType"
40816+
],
40817+
"type": "object",
40818+
"properties": {
40819+
"$type": {
40820+
"type": "string"
40821+
},
40822+
"id": {
40823+
"type": "string",
40824+
"format": "uuid"
40825+
},
40826+
"name": {
40827+
"type": "string",
40828+
"nullable": true
40829+
},
40830+
"alias": {
40831+
"type": "string",
40832+
"nullable": true
40833+
},
40834+
"memberType": {
40835+
"oneOf": [
40836+
{
40837+
"$ref": "#/components/schemas/TrackedReferenceMemberTypeModel"
40838+
}
40839+
]
40840+
}
40841+
},
40842+
"additionalProperties": false,
40843+
"discriminator": {
40844+
"propertyName": "$type",
40845+
"mapping": {
40846+
"MemberTypePropertyReferenceResponseModel": "#/components/schemas/MemberTypePropertyReferenceResponseModel"
40847+
}
40848+
}
40849+
},
4073340850
"MemberTypePropertyTypeContainerResponseModel": {
4073440851
"required": [
4073540852
"id",

src/Umbraco.Core/Services/IDataTypeService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,5 +245,5 @@ Task<PagedModel<RelationItemModel>> GetPagedRelationsAsync(Guid key, int skip, i
245245
/// </summary>
246246
/// <param name="propertyEditorAlias">Aliases of the property editors</param>
247247
/// <returns>Collection of <see cref="IDataType" /> configured for the property editors</returns>
248-
Task<IEnumerable<IDataType>> GetByEditorAliasAsync(string[] propertyEditorAlias) => Task.FromResult(propertyEditorAlias.SelectMany(x=>GetByEditorAlias(x)));
248+
Task<IEnumerable<IDataType>> GetByEditorAliasAsync(string[] propertyEditorAlias) => Task.FromResult(propertyEditorAlias.SelectMany(x => GetByEditorAlias(x)));
249249
}

0 commit comments

Comments
 (0)