diff --git a/src/Hocon.API.Tests/HoconAPISpec.ApproveCore.approved.txt b/src/Hocon.API.Tests/HoconAPISpec.ApproveCore.approved.txt index 9ca888e8..8dd27775 100644 --- a/src/Hocon.API.Tests/HoconAPISpec.ApproveCore.approved.txt +++ b/src/Hocon.API.Tests/HoconAPISpec.ApproveCore.approved.txt @@ -407,6 +407,7 @@ namespace Hocon public override Hocon.HoconType Type { get; } public System.Collections.Generic.IDictionary Unwrapped { get; } public System.Collections.Generic.IEnumerable Values { get; } + [System.ObsoleteAttribute("Only used by Hyperion deserializer", true)] public void Add(string key, Hocon.HoconElement value) { } public void Add(System.Collections.Generic.KeyValuePair item) { } public virtual System.Collections.Generic.IEnumerable> AsEnumerable() { } diff --git a/src/Hocon/HoconObject.cs b/src/Hocon/HoconObject.cs index 6ef72265..b982fdc9 100644 --- a/src/Hocon/HoconObject.cs +++ b/src/Hocon/HoconObject.cs @@ -301,9 +301,10 @@ public override bool Equals(HoconElement other) return true; } + [Obsolete("Only used by Hyperion deserializer", true)] public void Add(string key, HoconElement value) { - throw new InvalidOperationException("HoconObject is a read only Dictionary."); + Fields = Fields.Add(key, value); } public bool Remove(string key)