From d69da0de6b5a29a397324606b48cf5a4b4c9bd07 Mon Sep 17 00:00:00 2001 From: v-haiboz Date: Tue, 20 Jul 2021 13:52:50 +0800 Subject: [PATCH] Bug#459689:Parameter of example disappear. --- .../RestOperationTransformer.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Microsoft.RestApi.RestTransformer/RestOperationTransformer.cs b/Microsoft.RestApi.RestTransformer/RestOperationTransformer.cs index b32a106..1aa1ff3 100644 --- a/Microsoft.RestApi.RestTransformer/RestOperationTransformer.cs +++ b/Microsoft.RestApi.RestTransformer/RestOperationTransformer.cs @@ -582,7 +582,15 @@ private static string GetExampleRequestUri(IList paths, Dictionary !q.Contains("={"))); + if (msExampleParameters != null) + { + contents[1] = string.Join("&", queries.Where(q => msExampleParameters.Any(p => q.Contains(Convert.ToString(p.Value))) || !q.Contains("={"))); + } + else + { + contents[1] = string.Join("&", queries.Where(q => !q.Contains("={"))); + } + if (string.IsNullOrEmpty(contents[1])) { pathContent = contents[0];