From 9237f38b5eefd199890b601a3767b5e71865ed75 Mon Sep 17 00:00:00 2001 From: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com> Date: Thu, 28 Mar 2024 16:39:08 +0300 Subject: [PATCH] Generates unique DELETE operation ids of `$ref` paths for indexed collection navigation properties (#513) * Get unique operation id for $ref DELETE with index nav. prop. * Add new reusable property * Update tests * Update release notes --- .../Microsoft.OpenAPI.OData.Reader.csproj | 14 ++------ .../NavigationPropertyOperationHandler.cs | 10 ++++-- .../Operation/RefDeleteOperationHandler.cs | 20 +++++++++-- .../Resources/Multiple.Schema.OpenApi.V2.json | 6 ++-- .../Resources/Multiple.Schema.OpenApi.V2.yaml | 6 ++-- .../Resources/Multiple.Schema.OpenApi.json | 6 ++-- .../Resources/Multiple.Schema.OpenApi.yaml | 6 ++-- .../Resources/TripService.OpenApi.V2.json | 36 +++++++++---------- .../Resources/TripService.OpenApi.V2.yaml | 36 +++++++++---------- .../Resources/TripService.OpenApi.json | 36 +++++++++---------- .../Resources/TripService.OpenApi.yaml | 36 +++++++++---------- 11 files changed, 111 insertions(+), 101 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index 721d36b1..7776278e 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -15,23 +15,13 @@ netstandard2.0 Microsoft.OpenApi.OData true - 1.6.0 + 1.6.1 This package contains the codes you need to convert OData CSDL to Open API Document of Model. © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM https://github.com/Microsoft/OpenAPI.NET.OData -- Reads annotations on structural properties of stream types for media entity paths #399 -- Updates the format of the request body schema of a collection of complex property #423 -- Adds a delete operation and a required @id query parameter to collection-valued navigation property paths with $ref #453 -- Fixes inconsistency of nullability of schemas of properties that are a collection of structured types #467 -- Generates $expand query parameter for operations whose return type is a collection #481 -- Adds delete operation for non-contained navigation properties only if explicitly allowed via annotation #483 -- Appends parameters and fixes operation ids of navigation property paths generated via composable functions #486 -- Use alternate keys in the generation of operation ids of operations and navigation property alternate paths #488 -- Fixes operation ids of paths with type cast segments #492 -- Uses convert setting to toggle between generating query options schemas of type string array or enums #197 -- Adds ability to change the response or request body content media type based on custom annotation properties #405 +- Generates unique DELETE operation ids of $ref paths for indexed collection navigation properties #513 Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs index 2bbb3131..8fe72945 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs @@ -39,7 +39,12 @@ internal abstract class NavigationPropertyOperationHandler : OperationHandler /// /// Gets a bool value indicating whether the last segment is a key segment. /// - protected bool LastSegmentIsKeySegment { get; private set; } + protected bool LastSegmentIsKeySegment { get; private set; } + + /// + /// Gets a bool value indicating whether the second last segment in a $ref path is a key segment + /// + protected bool SecondLastSegmentIsKeySegment { get; private set; } /// /// Gets a bool value indicating whether the last segment is a $ref segment. @@ -55,7 +60,8 @@ protected override void Initialize(ODataContext context, ODataPath path) NavigationSource = navigationSourceSegment.NavigationSource; LastSegmentIsKeySegment = path.LastSegment is ODataKeySegment; - LastSegmentIsRefSegment = path.LastSegment is ODataRefSegment; + LastSegmentIsRefSegment = path.LastSegment is ODataRefSegment; + SecondLastSegmentIsKeySegment = Path.Segments.Reverse().Skip(1).Take(1).Single().Kind == ODataSegmentKind.Key; NavigationProperty = path.OfType().Last().NavigationProperty; IEdmEntitySet entitySet = NavigationSource as IEdmEntitySet; diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/RefDeleteOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/RefDeleteOperationHandler.cs index 0d8d12cd..d986396b 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/RefDeleteOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/RefDeleteOperationHandler.cs @@ -3,13 +3,13 @@ // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. // ------------------------------------------------------------ -using System.Linq; using Microsoft.OData.Edm; using Microsoft.OpenApi.Models; using Microsoft.OpenApi.OData.Common; using Microsoft.OpenApi.OData.Edm; using Microsoft.OpenApi.OData.Generator; using Microsoft.OpenApi.OData.Vocabulary.Capabilities; +using System.Linq; namespace Microsoft.OpenApi.OData.Operation { @@ -40,8 +40,22 @@ protected override void SetBasicInfo(OpenApiOperation operation) // OperationId if (Context.Settings.EnableOperationId) { - string prefix = "DeleteRef"; - operation.OperationId = GetOperationId(prefix); + string prefix = "DeleteRef"; + var segments = GetOperationId().Split('.').ToList(); + + if (SecondLastSegmentIsKeySegment) + { + segments[segments.Count - 1] = Utils.ToFirstCharacterLowerCase(segments[segments.Count - 1]); + var lastSegment = prefix + Utils.UpperFirstChar(NavigationProperty.ToEntityType().Name); + segments.Add(lastSegment); + operation.OperationId = string.Join(".", segments); + } + else + { + var lastSegment = segments.LastOrDefault(); + segments[segments.Count - 1] = prefix + lastSegment; + operation.OperationId = string.Join(".", segments); + } } } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index a80a3ecd..7bcc154c 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -760,7 +760,7 @@ "Documents.RevisionDto" ], "summary": "Delete ref of navigation property Revisions for Documents", - "operationId": "Documents.DeleteRefRevisions", + "operationId": "Documents.revisions.DeleteRefRevisionDto", "parameters": [ { "in": "path", @@ -1673,7 +1673,7 @@ "Libraries.DocumentDto" ], "summary": "Delete ref of navigation property Documents for Libraries", - "operationId": "Libraries.DeleteRefDocuments", + "operationId": "Libraries.documents.DeleteRefDocumentDto", "parameters": [ { "in": "path", @@ -3688,7 +3688,7 @@ "Tasks.RevisionDto" ], "summary": "Delete ref of navigation property Revisions for Tasks", - "operationId": "Tasks.DeleteRefRevisions", + "operationId": "Tasks.revisions.DeleteRefRevisionDto", "parameters": [ { "in": "path", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index 51d94bdf..e69a85f5 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -541,7 +541,7 @@ paths: tags: - Documents.RevisionDto summary: Delete ref of navigation property Revisions for Documents - operationId: Documents.DeleteRefRevisions + operationId: Documents.revisions.DeleteRefRevisionDto parameters: - in: path name: Id @@ -1185,7 +1185,7 @@ paths: tags: - Libraries.DocumentDto summary: Delete ref of navigation property Documents for Libraries - operationId: Libraries.DeleteRefDocuments + operationId: Libraries.documents.DeleteRefDocumentDto parameters: - in: path name: Id @@ -2623,7 +2623,7 @@ paths: tags: - Tasks.RevisionDto summary: Delete ref of navigation property Revisions for Tasks - operationId: Tasks.DeleteRefRevisions + operationId: Tasks.revisions.DeleteRefRevisionDto parameters: - in: path name: Id diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index ce0f2ac5..bb39c082 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -851,7 +851,7 @@ "Documents.RevisionDto" ], "summary": "Delete ref of navigation property Revisions for Documents", - "operationId": "Documents.DeleteRefRevisions", + "operationId": "Documents.revisions.DeleteRefRevisionDto", "parameters": [ { "name": "Id", @@ -1863,7 +1863,7 @@ "Libraries.DocumentDto" ], "summary": "Delete ref of navigation property Documents for Libraries", - "operationId": "Libraries.DeleteRefDocuments", + "operationId": "Libraries.documents.DeleteRefDocumentDto", "parameters": [ { "name": "Id", @@ -4128,7 +4128,7 @@ "Tasks.RevisionDto" ], "summary": "Delete ref of navigation property Revisions for Tasks", - "operationId": "Tasks.DeleteRefRevisions", + "operationId": "Tasks.revisions.DeleteRefRevisionDto", "parameters": [ { "name": "Id", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index 440c2836..aa66b9c7 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -602,7 +602,7 @@ paths: tags: - Documents.RevisionDto summary: Delete ref of navigation property Revisions for Documents - operationId: Documents.DeleteRefRevisions + operationId: Documents.revisions.DeleteRefRevisionDto parameters: - name: Id in: path @@ -1312,7 +1312,7 @@ paths: tags: - Libraries.DocumentDto summary: Delete ref of navigation property Documents for Libraries - operationId: Libraries.DeleteRefDocuments + operationId: Libraries.documents.DeleteRefDocumentDto parameters: - name: Id in: path @@ -2913,7 +2913,7 @@ paths: tags: - Tasks.RevisionDto summary: Delete ref of navigation property Revisions for Tasks - operationId: Tasks.DeleteRefRevisions + operationId: Tasks.revisions.DeleteRefRevisionDto parameters: - name: Id in: path diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index b3a569a7..2a035d85 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -2238,7 +2238,7 @@ "Me.Person" ], "summary": "Delete ref of navigation property Friends for Me", - "operationId": "Me.DeleteRefFriends", + "operationId": "Me.friends.DeleteRefPerson", "parameters": [ { "in": "path", @@ -4261,7 +4261,7 @@ "Me.Person" ], "summary": "Delete ref of navigation property Friends for Me", - "operationId": "Me.AsEmployee.DeleteRefFriends", + "operationId": "Me.AsEmployee.friends.DeleteRefPerson", "parameters": [ { "in": "path", @@ -5228,7 +5228,7 @@ "Me.Person" ], "summary": "Delete ref of navigation property Peers for Me", - "operationId": "Me.AsEmployee.DeleteRefPeers", + "operationId": "Me.AsEmployee.peers.DeleteRefPerson", "parameters": [ { "in": "path", @@ -6329,7 +6329,7 @@ "Me.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for Me", - "operationId": "Me.AsEmployee.Trips.DeleteRefPlanItems", + "operationId": "Me.AsEmployee.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "in": "path", @@ -7768,7 +7768,7 @@ "Me.Person" ], "summary": "Delete ref of navigation property DirectReports for Me", - "operationId": "Me.AsManager.DeleteRefDirectReports", + "operationId": "Me.AsManager.directReports.DeleteRefPerson", "parameters": [ { "in": "path", @@ -8491,7 +8491,7 @@ "Me.Person" ], "summary": "Delete ref of navigation property Friends for Me", - "operationId": "Me.AsManager.DeleteRefFriends", + "operationId": "Me.AsManager.friends.DeleteRefPerson", "parameters": [ { "in": "path", @@ -9910,7 +9910,7 @@ "Me.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for Me", - "operationId": "Me.AsManager.Trips.DeleteRefPlanItems", + "operationId": "Me.AsManager.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "in": "path", @@ -10749,7 +10749,7 @@ "Me.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for Me", - "operationId": "Me.Trips.DeleteRefPlanItems", + "operationId": "Me.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "in": "path", @@ -12414,7 +12414,7 @@ "NewComePeople.Person" ], "summary": "Delete ref of navigation property Friends for NewComePeople", - "operationId": "NewComePeople.DeleteRefFriends", + "operationId": "NewComePeople.friends.DeleteRefPerson", "parameters": [ { "in": "path", @@ -14250,7 +14250,7 @@ "NewComePeople.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for NewComePeople", - "operationId": "NewComePeople.Trips.DeleteRefPlanItems", + "operationId": "NewComePeople.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "in": "path", @@ -16015,7 +16015,7 @@ "People.Person" ], "summary": "Delete ref of navigation property Friends for People", - "operationId": "People.DeleteRefFriends", + "operationId": "People.friends.DeleteRefPerson", "parameters": [ { "in": "path", @@ -18428,7 +18428,7 @@ "People.Person" ], "summary": "Delete ref of navigation property Friends for People", - "operationId": "People.AsEmployee.DeleteRefFriends", + "operationId": "People.AsEmployee.friends.DeleteRefPerson", "parameters": [ { "in": "path", @@ -19565,7 +19565,7 @@ "People.Person" ], "summary": "Delete ref of navigation property Peers for People", - "operationId": "People.AsEmployee.DeleteRefPeers", + "operationId": "People.AsEmployee.peers.DeleteRefPerson", "parameters": [ { "in": "path", @@ -20834,7 +20834,7 @@ "People.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for People", - "operationId": "People.AsEmployee.Trips.DeleteRefPlanItems", + "operationId": "People.AsEmployee.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "in": "path", @@ -22551,7 +22551,7 @@ "People.Person" ], "summary": "Delete ref of navigation property DirectReports for People", - "operationId": "People.AsManager.DeleteRefDirectReports", + "operationId": "People.AsManager.directReports.DeleteRefPerson", "parameters": [ { "in": "path", @@ -23394,7 +23394,7 @@ "People.Person" ], "summary": "Delete ref of navigation property Friends for People", - "operationId": "People.AsManager.DeleteRefFriends", + "operationId": "People.AsManager.friends.DeleteRefPerson", "parameters": [ { "in": "path", @@ -25039,7 +25039,7 @@ "People.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for People", - "operationId": "People.AsManager.Trips.DeleteRefPlanItems", + "operationId": "People.AsManager.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "in": "path", @@ -25998,7 +25998,7 @@ "People.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for People", - "operationId": "People.Trips.DeleteRefPlanItems", + "operationId": "People.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "in": "path", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index b0d5767f..cd7efc5f 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -1484,7 +1484,7 @@ paths: tags: - Me.Person summary: Delete ref of navigation property Friends for Me - operationId: Me.DeleteRefFriends + operationId: Me.friends.DeleteRefPerson parameters: - in: path name: UserName @@ -2836,7 +2836,7 @@ paths: tags: - Me.Person summary: Delete ref of navigation property Friends for Me - operationId: Me.AsEmployee.DeleteRefFriends + operationId: Me.AsEmployee.friends.DeleteRefPerson parameters: - in: path name: UserName @@ -3481,7 +3481,7 @@ paths: tags: - Me.Person summary: Delete ref of navigation property Peers for Me - operationId: Me.AsEmployee.DeleteRefPeers + operationId: Me.AsEmployee.peers.DeleteRefPerson parameters: - in: path name: UserName @@ -4225,7 +4225,7 @@ paths: tags: - Me.Trips.PlanItem summary: Delete ref of navigation property PlanItems for Me - operationId: Me.AsEmployee.Trips.DeleteRefPlanItems + operationId: Me.AsEmployee.Trips.planItems.DeleteRefPlanItem parameters: - in: path name: TripId @@ -5193,7 +5193,7 @@ paths: tags: - Me.Person summary: Delete ref of navigation property DirectReports for Me - operationId: Me.AsManager.DeleteRefDirectReports + operationId: Me.AsManager.directReports.DeleteRefPerson parameters: - in: path name: UserName @@ -5676,7 +5676,7 @@ paths: tags: - Me.Person summary: Delete ref of navigation property Friends for Me - operationId: Me.AsManager.DeleteRefFriends + operationId: Me.AsManager.friends.DeleteRefPerson parameters: - in: path name: UserName @@ -6633,7 +6633,7 @@ paths: tags: - Me.Trips.PlanItem summary: Delete ref of navigation property PlanItems for Me - operationId: Me.AsManager.Trips.DeleteRefPlanItems + operationId: Me.AsManager.Trips.planItems.DeleteRefPlanItem parameters: - in: path name: TripId @@ -7208,7 +7208,7 @@ paths: tags: - Me.Trips.PlanItem summary: Delete ref of navigation property PlanItems for Me - operationId: Me.Trips.DeleteRefPlanItems + operationId: Me.Trips.planItems.DeleteRefPlanItem parameters: - in: path name: TripId @@ -8329,7 +8329,7 @@ paths: tags: - NewComePeople.Person summary: Delete ref of navigation property Friends for NewComePeople - operationId: NewComePeople.DeleteRefFriends + operationId: NewComePeople.friends.DeleteRefPerson parameters: - in: path name: UserName @@ -9537,7 +9537,7 @@ paths: tags: - NewComePeople.Trips.PlanItem summary: Delete ref of navigation property PlanItems for NewComePeople - operationId: NewComePeople.Trips.DeleteRefPlanItems + operationId: NewComePeople.Trips.planItems.DeleteRefPlanItem parameters: - in: path name: UserName @@ -10735,7 +10735,7 @@ paths: tags: - People.Person summary: Delete ref of navigation property Friends for People - operationId: People.DeleteRefFriends + operationId: People.friends.DeleteRefPerson parameters: - in: path name: UserName @@ -12376,7 +12376,7 @@ paths: tags: - People.Person summary: Delete ref of navigation property Friends for People - operationId: People.AsEmployee.DeleteRefFriends + operationId: People.AsEmployee.friends.DeleteRefPerson parameters: - in: path name: UserName @@ -13148,7 +13148,7 @@ paths: tags: - People.Person summary: Delete ref of navigation property Peers for People - operationId: People.AsEmployee.DeleteRefPeers + operationId: People.AsEmployee.peers.DeleteRefPerson parameters: - in: path name: UserName @@ -14018,7 +14018,7 @@ paths: tags: - People.Trips.PlanItem summary: Delete ref of navigation property PlanItems for People - operationId: People.AsEmployee.Trips.DeleteRefPlanItems + operationId: People.AsEmployee.Trips.planItems.DeleteRefPlanItem parameters: - in: path name: UserName @@ -15191,7 +15191,7 @@ paths: tags: - People.Person summary: Delete ref of navigation property DirectReports for People - operationId: People.AsManager.DeleteRefDirectReports + operationId: People.AsManager.directReports.DeleteRefPerson parameters: - in: path name: UserName @@ -15764,7 +15764,7 @@ paths: tags: - People.Person summary: Delete ref of navigation property Friends for People - operationId: People.AsManager.DeleteRefFriends + operationId: People.AsManager.friends.DeleteRefPerson parameters: - in: path name: UserName @@ -16890,7 +16890,7 @@ paths: tags: - People.Trips.PlanItem summary: Delete ref of navigation property PlanItems for People - operationId: People.AsManager.Trips.DeleteRefPlanItems + operationId: People.AsManager.Trips.planItems.DeleteRefPlanItem parameters: - in: path name: UserName @@ -17555,7 +17555,7 @@ paths: tags: - People.Trips.PlanItem summary: Delete ref of navigation property PlanItems for People - operationId: People.Trips.DeleteRefPlanItems + operationId: People.Trips.planItems.DeleteRefPlanItem parameters: - in: path name: UserName diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index 02e09263..cc363774 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -2512,7 +2512,7 @@ "Me.Person" ], "summary": "Delete ref of navigation property Friends for Me", - "operationId": "Me.DeleteRefFriends", + "operationId": "Me.friends.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -4733,7 +4733,7 @@ "Me.Person" ], "summary": "Delete ref of navigation property Friends for Me", - "operationId": "Me.AsEmployee.DeleteRefFriends", + "operationId": "Me.AsEmployee.friends.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -5805,7 +5805,7 @@ "Me.Person" ], "summary": "Delete ref of navigation property Peers for Me", - "operationId": "Me.AsEmployee.DeleteRefPeers", + "operationId": "Me.AsEmployee.peers.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -7028,7 +7028,7 @@ "Me.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for Me", - "operationId": "Me.AsEmployee.Trips.DeleteRefPlanItems", + "operationId": "Me.AsEmployee.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "name": "TripId", @@ -8595,7 +8595,7 @@ "Me.Person" ], "summary": "Delete ref of navigation property DirectReports for Me", - "operationId": "Me.AsManager.DeleteRefDirectReports", + "operationId": "Me.AsManager.directReports.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -9391,7 +9391,7 @@ "Me.Person" ], "summary": "Delete ref of navigation property Friends for Me", - "operationId": "Me.AsManager.DeleteRefFriends", + "operationId": "Me.AsManager.friends.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -10973,7 +10973,7 @@ "Me.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for Me", - "operationId": "Me.AsManager.Trips.DeleteRefPlanItems", + "operationId": "Me.AsManager.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "name": "TripId", @@ -11905,7 +11905,7 @@ "Me.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for Me", - "operationId": "Me.Trips.DeleteRefPlanItems", + "operationId": "Me.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "name": "TripId", @@ -13770,7 +13770,7 @@ "NewComePeople.Person" ], "summary": "Delete ref of navigation property Friends for NewComePeople", - "operationId": "NewComePeople.DeleteRefFriends", + "operationId": "NewComePeople.friends.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -15900,7 +15900,7 @@ "NewComePeople.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for NewComePeople", - "operationId": "NewComePeople.Trips.DeleteRefPlanItems", + "operationId": "NewComePeople.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "name": "UserName", @@ -17873,7 +17873,7 @@ "People.Person" ], "summary": "Delete ref of navigation property Friends for People", - "operationId": "People.DeleteRefFriends", + "operationId": "People.friends.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -20592,7 +20592,7 @@ "People.Person" ], "summary": "Delete ref of navigation property Friends for People", - "operationId": "People.AsEmployee.DeleteRefFriends", + "operationId": "People.AsEmployee.friends.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -21880,7 +21880,7 @@ "People.Person" ], "summary": "Delete ref of navigation property Peers for People", - "operationId": "People.AsEmployee.DeleteRefPeers", + "operationId": "People.AsEmployee.peers.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -23317,7 +23317,7 @@ "People.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for People", - "operationId": "People.AsEmployee.Trips.DeleteRefPlanItems", + "operationId": "People.AsEmployee.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "name": "UserName", @@ -25240,7 +25240,7 @@ "People.Person" ], "summary": "Delete ref of navigation property DirectReports for People", - "operationId": "People.AsManager.DeleteRefDirectReports", + "operationId": "People.AsManager.directReports.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -26188,7 +26188,7 @@ "People.Person" ], "summary": "Delete ref of navigation property Friends for People", - "operationId": "People.AsManager.DeleteRefFriends", + "operationId": "People.AsManager.friends.DeleteRefPerson", "parameters": [ { "name": "UserName", @@ -28060,7 +28060,7 @@ "People.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for People", - "operationId": "People.AsManager.Trips.DeleteRefPlanItems", + "operationId": "People.AsManager.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "name": "UserName", @@ -29146,7 +29146,7 @@ "People.Trips.PlanItem" ], "summary": "Delete ref of navigation property PlanItems for People", - "operationId": "People.Trips.DeleteRefPlanItems", + "operationId": "People.Trips.planItems.DeleteRefPlanItem", "parameters": [ { "name": "UserName", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index 51a20b35..1353276f 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -1658,7 +1658,7 @@ paths: tags: - Me.Person summary: Delete ref of navigation property Friends for Me - operationId: Me.DeleteRefFriends + operationId: Me.friends.DeleteRefPerson parameters: - name: UserName in: path @@ -3154,7 +3154,7 @@ paths: tags: - Me.Person summary: Delete ref of navigation property Friends for Me - operationId: Me.AsEmployee.DeleteRefFriends + operationId: Me.AsEmployee.friends.DeleteRefPerson parameters: - name: UserName in: path @@ -3873,7 +3873,7 @@ paths: tags: - Me.Person summary: Delete ref of navigation property Peers for Me - operationId: Me.AsEmployee.DeleteRefPeers + operationId: Me.AsEmployee.peers.DeleteRefPerson parameters: - name: UserName in: path @@ -4700,7 +4700,7 @@ paths: tags: - Me.Trips.PlanItem summary: Delete ref of navigation property PlanItems for Me - operationId: Me.AsEmployee.Trips.DeleteRefPlanItems + operationId: Me.AsEmployee.Trips.planItems.DeleteRefPlanItem parameters: - name: TripId in: path @@ -5761,7 +5761,7 @@ paths: tags: - Me.Person summary: Delete ref of navigation property DirectReports for Me - operationId: Me.AsManager.DeleteRefDirectReports + operationId: Me.AsManager.directReports.DeleteRefPerson parameters: - name: UserName in: path @@ -6293,7 +6293,7 @@ paths: tags: - Me.Person summary: Delete ref of navigation property Friends for Me - operationId: Me.AsManager.DeleteRefFriends + operationId: Me.AsManager.friends.DeleteRefPerson parameters: - name: UserName in: path @@ -7361,7 +7361,7 @@ paths: tags: - Me.Trips.PlanItem summary: Delete ref of navigation property PlanItems for Me - operationId: Me.AsManager.Trips.DeleteRefPlanItems + operationId: Me.AsManager.Trips.planItems.DeleteRefPlanItem parameters: - name: TripId in: path @@ -8000,7 +8000,7 @@ paths: tags: - Me.Trips.PlanItem summary: Delete ref of navigation property PlanItems for Me - operationId: Me.Trips.DeleteRefPlanItems + operationId: Me.Trips.planItems.DeleteRefPlanItem parameters: - name: TripId in: path @@ -9250,7 +9250,7 @@ paths: tags: - NewComePeople.Person summary: Delete ref of navigation property Friends for NewComePeople - operationId: NewComePeople.DeleteRefFriends + operationId: NewComePeople.friends.DeleteRefPerson parameters: - name: UserName in: path @@ -10648,7 +10648,7 @@ paths: tags: - NewComePeople.Trips.PlanItem summary: Delete ref of navigation property PlanItems for NewComePeople - operationId: NewComePeople.Trips.DeleteRefPlanItems + operationId: NewComePeople.Trips.planItems.DeleteRefPlanItem parameters: - name: UserName in: path @@ -11979,7 +11979,7 @@ paths: tags: - People.Person summary: Delete ref of navigation property Friends for People - operationId: People.DeleteRefFriends + operationId: People.friends.DeleteRefPerson parameters: - name: UserName in: path @@ -13818,7 +13818,7 @@ paths: tags: - People.Person summary: Delete ref of navigation property Friends for People - operationId: People.AsEmployee.DeleteRefFriends + operationId: People.AsEmployee.friends.DeleteRefPerson parameters: - name: UserName in: path @@ -14687,7 +14687,7 @@ paths: tags: - People.Person summary: Delete ref of navigation property Peers for People - operationId: People.AsEmployee.DeleteRefPeers + operationId: People.AsEmployee.peers.DeleteRefPerson parameters: - name: UserName in: path @@ -15663,7 +15663,7 @@ paths: tags: - People.Trips.PlanItem summary: Delete ref of navigation property PlanItems for People - operationId: People.AsEmployee.Trips.DeleteRefPlanItems + operationId: People.AsEmployee.Trips.planItems.DeleteRefPlanItem parameters: - name: UserName in: path @@ -16968,7 +16968,7 @@ paths: tags: - People.Person summary: Delete ref of navigation property DirectReports for People - operationId: People.AsManager.DeleteRefDirectReports + operationId: People.AsManager.directReports.DeleteRefPerson parameters: - name: UserName in: path @@ -17606,7 +17606,7 @@ paths: tags: - People.Person summary: Delete ref of navigation property Friends for People - operationId: People.AsManager.DeleteRefFriends + operationId: People.AsManager.friends.DeleteRefPerson parameters: - name: UserName in: path @@ -18875,7 +18875,7 @@ paths: tags: - People.Trips.PlanItem summary: Delete ref of navigation property PlanItems for People - operationId: People.AsManager.Trips.DeleteRefPlanItems + operationId: People.AsManager.Trips.planItems.DeleteRefPlanItem parameters: - name: UserName in: path @@ -19621,7 +19621,7 @@ paths: tags: - People.Trips.PlanItem summary: Delete ref of navigation property PlanItems for People - operationId: People.Trips.DeleteRefPlanItems + operationId: People.Trips.planItems.DeleteRefPlanItem parameters: - name: UserName in: path