Skip to content

Commit 23a9fbe

Browse files
Microsoft Graph DevX ToolingMicrosoft Graph DevX Tooling
authored andcommitted
Updated EdmOperationHandler to add a suffix incase operation segment is a an action or a function
1 parent 0b77ca3 commit 23a9fbe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ protected override void SetTags(OpenApiOperation operation)
152152
}
153153

154154
/// <summary>
155-
/// Genrates the tag name for the operation.
155+
/// Genrates the tag name for the operation. Adds Action or Function name to the tag name if the operation is an action or function.
156156
/// </summary>
157157
/// <param name="tagName">The generated tag name.</param>
158158
/// <param name="skip">The number of segments to skip.</param>
@@ -165,14 +165,17 @@ private void GenerateTagName(out string tagName, int skip = 1)
165165
case ODataNavigationPropertySegment:
166166
tagName = EdmModelHelper.GenerateNavigationPropertyPathTagName(Path, Context);
167167
break;
168-
case ODataOperationSegment:
169168
case ODataOperationImportSegment:
170169
// Previous segmment could be a navigation property or a navigation source segment
171170
case ODataKeySegment:
172171
skip += 1;
173172
GenerateTagName(out tagName, skip);
174173
break;
175-
// ODataNavigationSourceSegment
174+
// If the operation is a function or action, append the word "Function" or "Action" to the tag name
175+
case ODataOperationSegment operationSegment:
176+
string suffixName = operationSegment.Operation.IsAction() ? operationSegment.Operation.Name + "Actions" : operationSegment.Operation.Name + "Functions";
177+
tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name + "." + suffixName;
178+
break;
176179
default:
177180
tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name;
178181
break;

0 commit comments

Comments
 (0)