Skip to content

Commit e704f82

Browse files
committed
Ensure unique operation ids for composable functions with both overloaded
1 parent b919ea8 commit e704f82

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ protected override void SetBasicInfo(OpenApiOperation operation)
107107
if (opSegment.Operation is IEdmFunction function && Context.Model.IsOperationOverload(function))
108108
{
109109
// Hash the segment to avoid duplicate operationIds
110-
pathHash = segment.GetPathHash(Context.Settings);
110+
pathHash = string.IsNullOrEmpty(pathHash)
111+
? opSegment.GetPathHash(Context.Settings)
112+
: (pathHash + opSegment.GetPathHash(Context.Settings)).GetHashSHA256()[..4];
111113
}
112114

113115
identifiers.Add(segment.Identifier);

0 commit comments

Comments
 (0)