-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Ref at
private static string SingularizeAndDeduplicateOperationId(string operationId) |
Related to microsoft/OpenAPI.NET.OData#604
Given
Path 1 as /users/{user-id}/calendars/{calendar-id}/microsoft.graph.getSchedule
with operationId as users.user.calendars.calendar.getSchedule
Path 2 as /users/{user-id}/calendar/microsoft.graph.getSchedule
with operationId as users.user.calendar.getSchedule
The current PowershellFormatter will result in the generation of duplicate operationIds on slicing as the singularization logic will singularize
Operation Id 1 to user.user.calendar.calendar.getSchedule
Operation Id 2 to user.user.calendar.getSchedule
Then duplicate segments that follow each other will be dropped to have both paths having the same operation id as user.calendar.getSchedule`.
This would be invalid and cause issues with generation in Powershell in the event such a path existed in the same document.
The PowershellFormatter would an update do have some form of deduplication logic to ensure that singuralization looks up existing operationIds to prevent duplicate ids.