Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composable functions with optional arguments lead to duplicate operationId #580

Closed
baywet opened this issue Sep 13, 2024 · 1 comment · Fixed by #590
Closed

composable functions with optional arguments lead to duplicate operationId #580

baywet opened this issue Sep 13, 2024 · 1 comment · Fixed by #590
Assignees
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:bug A broken experience

Comments

@baywet
Copy link
Member

baywet commented Sep 13, 2024

consider the two follow endpoints:

  • /drives/{drive-id}/items/{driveItem-id}/workbook/worksheets/{workbookWorksheet-id}/range(address=''{address}'')/resizedRange(deltaRows={deltaRows},deltaColumns={deltaColumns})
  • /drives/{drive-id}/items/{driveItem-id}/workbook/worksheets/{workbookWorksheet-id}/range()/resizedRange(deltaRows={deltaRows},deltaColumns={deltaColumns})

Get the same operation Id: drives.drive.items.driveItem.workbook.worksheets.workbookWorksheet.range.resizedRange

This results in an invalid OAS description.

As far as I know, the only thing that depends on operation ids anymore on our end is PowerShell generation. But this is likely not impacting PowerShell since, as far as I know, we're stripping all functions out when slicing the description for PowerShell.

I believe the solution here would be to come up with a convention when the parameter is expanded, so the first endpoint Id should in fact be something like this:

drives.drive.items.driveItem.workbook.worksheets.workbookWorksheet.rangeByAddress.resizedRange

@baywet baywet added type:bug A broken experience priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days labels Sep 13, 2024
@irvinesunday irvinesunday self-assigned this Oct 1, 2024
@irvinesunday
Copy link
Contributor

I think a simpler solution would be to:

  1. Identify whether the operation is part of a composable function path.
  2. If the above is true, check whether either of the operation segment has parameters
  3. If the above is true, create a path hash based on the operation path and add it as a suffix to the operation id. For example, the operation Id of the 1st endpoint could be: drives.drive.items.driveItem.workbook.worksheets.workbookWorksheet.range.resizedRange-d7ec and the second endpoint: drives.drive.items.driveItem.workbook.worksheets.workbookWorksheet.range.resizedRange-a1b3

This will be consistent with how we disambiguate .../$count paths operation ids, for example: /drives/{drive-id}/items/{driveItem-id}/workbook/worksheets/$count --> drives.items.workbook.worksheets.GetCount-98c0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:bug A broken experience
Projects
None yet
2 participants