Skip to content

Commit 284ad67

Browse files
Microsoft Graph DevX ToolingMicrosoft Graph DevX Tooling
authored andcommitted
Adds action/function suffix to tag names for action/function operations
1 parent 8646818 commit 284ad67

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ protected override void SetTags(OpenApiOperation operation)
147147
}
148148

149149
/// <summary>
150-
/// Genrates the tag name for the operation.
150+
/// Genrates the tag name for the operation. Adds Action or Function name to the tag name if the operation is an action or function.
151151
/// </summary>
152152
/// <param name="tagName">The generated tag name.</param>
153153
/// <param name="skip">The number of segments to skip.</param>
@@ -160,14 +160,25 @@ private void GenerateTagName(out string tagName, int skip = 1)
160160
case ODataNavigationPropertySegment:
161161
tagName = EdmModelHelper.GenerateNavigationPropertyPathTagName(Path, Context);
162162
break;
163-
case ODataOperationSegment:
164163
case ODataOperationImportSegment:
165164
// Previous segmment could be a navigation property or a navigation source segment
166165
case ODataKeySegment:
167166
skip += 1;
168167
GenerateTagName(out tagName, skip);
169168
break;
170-
// ODataNavigationSourceSegment
169+
// If the operation is a function or action, append the word "Function" or "Action" to the tag name
170+
case ODataOperationSegment operationSegment:
171+
tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name;
172+
if(operationSegment.Operation.IsAction())
173+
{
174+
tagName += ".Actions";
175+
}
176+
177+
if(operationSegment.Operation.IsFunction())
178+
{
179+
tagName += ".Functions";
180+
}
181+
break;
171182
default:
172183
tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name;
173184
break;

0 commit comments

Comments
 (0)