Skip to content

Commit 5ee351a

Browse files
Added $type to ReferenceResponseModels (#18293)
* Added $type to ReferenceResponseModels * Updated OpenApi.json and client-side types. --------- Co-authored-by: Andy Butland <[email protected]>
1 parent 6e20e14 commit 5ee351a

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

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

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36517,10 +36517,14 @@
3651736517
},
3651836518
"DefaultReferenceResponseModel": {
3651936519
"required": [
36520+
"$type",
3652036521
"id"
3652136522
],
3652236523
"type": "object",
3652336524
"properties": {
36525+
"$type": {
36526+
"type": "string"
36527+
},
3652436528
"id": {
3652536529
"type": "string",
3652636530
"format": "uuid"
@@ -36538,7 +36542,13 @@
3653836542
"nullable": true
3653936543
}
3654036544
},
36541-
"additionalProperties": false
36545+
"additionalProperties": false,
36546+
"discriminator": {
36547+
"propertyName": "$type",
36548+
"mapping": {
36549+
"DefaultReferenceResponseModel": "#/components/schemas/DefaultReferenceResponseModel"
36550+
}
36551+
}
3654236552
},
3654336553
"DeleteUserGroupsRequestModel": {
3654436554
"required": [
@@ -37058,11 +37068,15 @@
3705837068
},
3705937069
"DocumentReferenceResponseModel": {
3706037070
"required": [
37071+
"$type",
3706137072
"documentType",
3706237073
"id"
3706337074
],
3706437075
"type": "object",
3706537076
"properties": {
37077+
"$type": {
37078+
"type": "string"
37079+
},
3706637080
"id": {
3706737081
"type": "string",
3706837082
"format": "uuid"
@@ -37083,7 +37097,13 @@
3708337097
]
3708437098
}
3708537099
},
37086-
"additionalProperties": false
37100+
"additionalProperties": false,
37101+
"discriminator": {
37102+
"propertyName": "$type",
37103+
"mapping": {
37104+
"DocumentReferenceResponseModel": "#/components/schemas/DocumentReferenceResponseModel"
37105+
}
37106+
}
3708737107
},
3708837108
"DocumentResponseModel": {
3708937109
"required": [
@@ -39191,11 +39211,15 @@
3919139211
},
3919239212
"MediaReferenceResponseModel": {
3919339213
"required": [
39214+
"$type",
3919439215
"id",
3919539216
"mediaType"
3919639217
],
3919739218
"type": "object",
3919839219
"properties": {
39220+
"$type": {
39221+
"type": "string"
39222+
},
3919939223
"id": {
3920039224
"type": "string",
3920139225
"format": "uuid"
@@ -39212,7 +39236,13 @@
3921239236
]
3921339237
}
3921439238
},
39215-
"additionalProperties": false
39239+
"additionalProperties": false,
39240+
"discriminator": {
39241+
"propertyName": "$type",
39242+
"mapping": {
39243+
"MediaReferenceResponseModel": "#/components/schemas/MediaReferenceResponseModel"
39244+
}
39245+
}
3921639246
},
3921739247
"MediaResponseModel": {
3921839248
"required": [

src/Umbraco.Cms.Api.Management/ViewModels/TrackedReferences/IReferenceResponseModel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
namespace Umbraco.Cms.Api.Management.ViewModels.TrackedReferences;
1+
using Umbraco.Cms.Api.Common.OpenApi;
22

3-
public interface IReferenceResponseModel
3+
namespace Umbraco.Cms.Api.Management.ViewModels.TrackedReferences;
4+
5+
public interface IReferenceResponseModel : IOpenApiDiscriminator
46
{
57
public Guid Id { get; }
68

0 commit comments

Comments
 (0)