Skip to content

Commit 96ff838

Browse files
Microsoft Graph DevX ToolingMicrosoft Graph DevX Tooling
authored andcommitted
Adds action/function suffix to tag names for action/function operations
1 parent 4db0cbc commit 96ff838

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

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

Lines changed: 15 additions & 4 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+
/// Generates 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,25 @@ 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:
170-
// Previous segmment could be a navigation property or a navigation source segment
169+
// Previous segment 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+
tagName = NavigationSource.Name + "." + NavigationSource.EntityType().Name;
177+
if(operationSegment.Operation.IsAction())
178+
{
179+
tagName += ".Actions";
180+
}
181+
182+
if(operationSegment.Operation.IsFunction())
183+
{
184+
tagName += ".Functions";
185+
}
186+
break;
176187
default:
177188
tagName = NavigationSource.Name + "." + NavigationSource.EntityType().Name;
178189
break;

0 commit comments

Comments
 (0)