Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected override void SetTags(OpenApiOperation operation)
}

/// <summary>
/// Genrates the tag name for the operation.
/// Genrates the tag name for the operation. Adds Action or Function name to the tag name if the operation is an action or function.
/// </summary>
/// <param name="tagName">The generated tag name.</param>
/// <param name="skip">The number of segments to skip.</param>
Expand All @@ -165,14 +165,17 @@ private void GenerateTagName(out string tagName, int skip = 1)
case ODataNavigationPropertySegment:
tagName = EdmModelHelper.GenerateNavigationPropertyPathTagName(Path, Context);
break;
case ODataOperationSegment:
case ODataOperationImportSegment:
// Previous segmment could be a navigation property or a navigation source segment
case ODataKeySegment:
skip += 1;
GenerateTagName(out tagName, skip);
break;
// ODataNavigationSourceSegment
// If the operation is a function or action, append the word "Function" or "Action" to the tag name
case ODataOperationSegment operationSegment:
string suffixName = operationSegment.Operation.IsAction() ? operationSegment.Operation.Name + "Actions" : operationSegment.Operation.Name + "Functions";
tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name + "." + suffixName;
break;
default:
tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name;
break;
Expand Down
Loading