Skip to content

Commit 8807680

Browse files
committed
fix(Domain): Reverted improper renaming of the ExtensionAttributes propertty
1 parent d6f8a73 commit 8807680

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/core/Synapse.Application/Extensions/V1EventExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static CloudEvent AsCloudEvent(this V1Event e)
4141
ce.DataContentType = e.DataContentType;
4242
ce.DataSchema = e.DataSchema;
4343
ce.Data = e.Data;
44-
foreach(var extension in e.Extensions)
44+
foreach(var extension in e.ExtensionAttributes)
4545
{
4646
ce.SetAttributeFromString(extension.Key, extension.Value?.ToString()!);
4747
}

src/core/Synapse.Domain/Models/v1/V1Event.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ public V1Event(string id, Uri source, string type, string? specVersion)
108108
public virtual Neuroglia.Serialization.Dynamic? Data { get; protected set; }
109109

110110
/// <summary>
111-
/// Gets an <see cref="IDictionary{TKey, TValue}"/> that contains the event's extension key/value mappings
111+
/// Gets an <see cref="IDictionary{TKey, TValue}"/> that contains the event's extension attributes key/value mappings
112112
/// </summary>
113113
[Newtonsoft.Json.JsonExtensionData]
114114
[System.Text.Json.Serialization.JsonExtensionData]
115-
public virtual IDictionary<string, object> Extensions { get; protected set; } = new Dictionary<string, object>();
115+
public virtual IDictionary<string, object> ExtensionAttributes { get; protected set; } = new Dictionary<string, object>();
116116

117117
/// <summary>
118118
/// Gets an <see cref="IReadOnlyDictionary{TKey, TValue}"/> containing all the <see cref="V1Event"/> attributes
@@ -145,9 +145,9 @@ IEnumerable<KeyValuePair<string, string>> AttributesEnumerator
145145
yield return new KeyValuePair<string, string>(nameof(Subject).ToLower(), this.Subject);
146146
if (this.Time.HasValue)
147147
yield return new KeyValuePair<string, string>(nameof(Time).ToLower(), this.Time.ToString()!);
148-
if(this.Extensions != null)
148+
if(this.ExtensionAttributes != null)
149149
{
150-
foreach (var extension in this.Extensions)
150+
foreach (var extension in this.ExtensionAttributes)
151151
yield return new(extension.Key, extension.Value.ToString()!);
152152
}
153153
}
@@ -215,7 +215,7 @@ public static V1Event CreateFrom(CloudEvent cloudEvent)
215215
e.Data = Neuroglia.Serialization.Dynamic.FromObject(data);
216216
foreach(var extensionsAttribute in cloudEvent.ExtensionAttributes)
217217
{
218-
e.Extensions.Add(extensionsAttribute.Name, extensionsAttribute.Format(cloudEvent[extensionsAttribute]!));
218+
e.ExtensionAttributes.Add(extensionsAttribute.Name, extensionsAttribute.Format(cloudEvent[extensionsAttribute]!));
219219
}
220220
return e;
221221
}

src/core/Synapse.Integration/Models/v1/Generated/V1Event.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ public partial class V1Event
9494
public virtual Dynamic Data { get; set; }
9595

9696
/// <summary>
97-
/// An IDictionary`2 that contains the event's extension key/value mappings
97+
/// An IDictionary`2 that contains the event's extension attributes key/value mappings
9898
/// </summary>
99-
[DataMember(Name = "extensions", Order = 10)]
100-
[Description("An IDictionary`2 that contains the event's extension key/value mappings")]
99+
[DataMember(Name = "extensionAttributes", Order = 10)]
100+
[Description("An IDictionary`2 that contains the event's extension attributes key/value mappings")]
101101
public virtual NameValueCollection<Dynamic> ExtensionAttributes { get; set; }
102102

103103
}

0 commit comments

Comments
 (0)