From 17ebbeba90a67c136c024fe3fe3a1a48676fcdf7 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Fri, 1 Mar 2024 11:57:14 +1300 Subject: [PATCH] Support list for `opensearch_version` in PluginStats Signed-off-by: Thomas Farr --- .../CommonOptions/Stats/PluginStats.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; }