@@ -81,7 +81,6 @@ protected override void SetBasicInfo(OpenApiOperation operation)
81
81
// duplicates in entity vs entityset functions/actions
82
82
83
83
List < string > identifiers = new ( ) ;
84
- string pathHash = string . Empty ;
85
84
foreach ( ODataSegment segment in Path . Segments )
86
85
{
87
86
if ( segment is ODataKeySegment keySegment )
@@ -102,18 +101,6 @@ protected override void SetBasicInfo(OpenApiOperation operation)
102
101
identifiers . Add ( keySegment . Identifier ) ;
103
102
}
104
103
}
105
- else if ( segment is ODataOperationSegment opSegment )
106
- {
107
- if ( opSegment . Operation is IEdmFunction function && Context . Model . IsOperationOverload ( function ) )
108
- {
109
- // Hash the segment to avoid duplicate operationIds
110
- pathHash = string . IsNullOrEmpty ( pathHash )
111
- ? opSegment . GetPathHash ( Context . Settings )
112
- : ( pathHash + opSegment . GetPathHash ( Context . Settings ) ) . GetHashSHA256 ( ) . Substring ( 0 , 4 ) ;
113
- }
114
-
115
- identifiers . Add ( segment . Identifier ) ;
116
- }
117
104
else
118
105
{
119
106
identifiers . Add ( segment . Identifier ) ;
@@ -122,13 +109,21 @@ protected override void SetBasicInfo(OpenApiOperation operation)
122
109
123
110
string operationId = string . Join ( "." , identifiers ) ;
124
111
125
- if ( ! string . IsNullOrEmpty ( pathHash ) )
112
+ if ( EdmOperation . IsAction ( ) )
126
113
{
127
- operation . OperationId = operationId + "-" + pathHash ;
114
+ operation . OperationId = operationId ;
128
115
}
129
116
else
130
117
{
131
- operation . OperationId = operationId ;
118
+ if ( Path . LastSegment is ODataOperationSegment operationSegment &&
119
+ Context . Model . IsOperationOverload ( operationSegment . Operation ) )
120
+ {
121
+ operation . OperationId = operationId + "-" + Path . LastSegment . GetPathHash ( Context . Settings ) ;
122
+ }
123
+ else
124
+ {
125
+ operation . OperationId = operationId ;
126
+ }
132
127
}
133
128
}
134
129
@@ -174,7 +169,7 @@ private void GenerateTagName(out string tagName, int skip = 1)
174
169
break ;
175
170
// ODataNavigationSourceSegment
176
171
default :
177
- tagName = NavigationSource . Name + "." + NavigationSource . EntityType ( ) . Name ;
172
+ tagName = NavigationSource . Name + "." + NavigationSource . EntityType . Name ;
178
173
break ;
179
174
}
180
175
}
0 commit comments