diff --git a/src/OpenSearch.Client/CommonOptions/Stats/PluginStats.cs b/src/OpenSearch.Client/CommonOptions/Stats/PluginStats.cs index 59094e5a7e..4c2a3a881a 100644 --- a/src/OpenSearch.Client/CommonOptions/Stats/PluginStats.cs +++ b/src/OpenSearch.Client/CommonOptions/Stats/PluginStats.cs @@ -27,7 +27,10 @@ */ using System.Collections.Generic; +using System.Linq; using System.Runtime.Serialization; +using OpenSearch.Net; +using OpenSearch.Net.Utf8Json; namespace OpenSearch.Client { @@ -41,7 +44,15 @@ public class PluginStats public string Description { get; set; } [DataMember(Name ="opensearch_version")] - public string OpenSearchVersion { get; set; } + [JsonFormatter(typeof(InterfaceReadOnlyCollectionSingleOrEnumerableFormatter))] + public IReadOnlyCollection OpenSearchVersions { get; set; } + + [IgnoreDataMember] + public string OpenSearchVersion + { + get => OpenSearchVersions?.SingleOrDefault(); + set => OpenSearchVersions = new [] { value }; + } [DataMember(Name ="extended_plugins")] public IReadOnlyCollection ExtendedPlugins { get; set; }