Skip to content

Commit 3dee785

Browse files
committed
fix: Add explanatory comment
1 parent 4baa745 commit 3dee785

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

DevProxy.Abstractions/Plugins/BasePlugin.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,22 @@ public TConfiguration Configuration
9999
}
100100
public IConfigurationSection ConfigurationSection { get; } = pluginConfigurationSection;
101101

102-
protected virtual IEnumerable<string>? GetConfigurationValue(string key, IEnumerable<string>? configuredList, IEnumerable<string>? defaultList = default)
102+
/// <summary>
103+
/// <para>Evaluates the <paramref name="key"/> array property.
104+
/// If the property exists, the <paramref name="configuredList"/> value is used;
105+
/// otherwise, the default <paramref name="defaultList"/> is applied.</para>
106+
/// <para>If the property is <i>null</i>, it is interpreted as an empty array (<i>[]</i>).</para>
107+
/// <para>Note: This is necessary because .NET configuration binding cannot differentiate between an empty array,
108+
/// a null value, or a missing property in appsettings.json.
109+
/// See at <see cref="https://github.com/dotnet/runtime/issues/58930"/>
110+
/// </para>
111+
/// </summary>
112+
/// <param name="key">The array property name</param>
113+
/// <param name="configuredList">The configured list of string values</param>
114+
/// <param name="defaultList">The default list of string values</param>
115+
/// <returns>Returns the result list of string values</returns>
116+
protected virtual IEnumerable<string>? GetConfigurationValue(string key, IEnumerable<string>? configuredList,
117+
IEnumerable<string>? defaultList = default)
103118
{
104119
ArgumentNullException.ThrowIfNull(key, nameof(key));
105120

0 commit comments

Comments
 (0)