Skip to content

Commit

Permalink
PR review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
irvinesunday committed Apr 13, 2023
1 parent 6fbe5a2 commit 621c3b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Microsoft.OpenApi.OData.Reader/Common/EdmModelHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 621c3b1

Please sign in to comment.