- fixes a bug where the operation id for count operations would not be unique
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
This commit is contained in:
parent
10b99ca357
commit
032fbaefb4
|
@ -25,7 +25,7 @@ namespace Microsoft.OpenApi.OData.Operation
|
|||
/// this segment could be "entity set", "Collection property", "Composable function whose return is collection",etc.
|
||||
/// </summary>
|
||||
internal ODataSegment LastSecondSegment { get; set; }
|
||||
|
||||
private const int SecondLastSegmentIndex = 2;
|
||||
/// <inheritdoc/>
|
||||
protected override void Initialize(ODataContext context, ODataPath path)
|
||||
{
|
||||
|
@ -33,7 +33,8 @@ namespace Microsoft.OpenApi.OData.Operation
|
|||
|
||||
// get the last second segment
|
||||
int count = path.Segments.Count;
|
||||
LastSecondSegment = path.Segments.ElementAt(count - 1);
|
||||
if(count >= SecondLastSegmentIndex)
|
||||
LastSecondSegment = path.Segments.ElementAt(count - SecondLastSegmentIndex);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
Loading…
Reference in a new issue