From 621c3b17596a863e016b59d96c52f14b6eca6cb0 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Thu, 13 Apr 2023 19:17:48 +0300 Subject: [PATCH] PR review suggestions --- src/Microsoft.OpenApi.OData.Reader/Common/EdmModelHelper.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Common/EdmModelHelper.cs b/src/Microsoft.OpenApi.OData.Reader/Common/EdmModelHelper.cs index d32f653a..1a3eefdb 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Common/EdmModelHelper.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Common/EdmModelHelper.cs @@ -379,10 +379,12 @@ internal static string StripOrAliasNamespacePrefix(IEdmSchemaElement element, Op segmentName = namespaceAlias.TrimEnd('.') + "." + element.Name; } - if (settings.NamespacePrefixToStripForInMethodPaths != null && + if (!string.IsNullOrEmpty(settings.NamespacePrefixToStripForInMethodPaths) && element.Namespace.Equals(settings.NamespacePrefixToStripForInMethodPaths, StringComparison.OrdinalIgnoreCase)) { - // Strip specified namespace from operation segment name + // Strip specified namespace from operation segment name. + // If the namespace prefix to strip matches the namespace name, + // and the alias has been appended, the alias will be stripped. segmentName = element.Name; } }