microsoft-graph-explorer-v4 icon indicating copy to clipboard operation
microsoft-graph-explorer-v4 copied to clipboard

Snippets generation failure for PowerShell & Go

Open adhiambovivian opened this issue 2 years ago • 8 comments

Bug: Code snippets are not generating for https://graph.microsoft.com/v1.0/organization/XXXX/branding/localizations for Powershell

image

adhiambovivian avatar May 17 '22 13:05 adhiambovivian

The PowerShell command for the query, which would be Get-MgOrganizationBrandingLocalization -OrganizationId $organizationId, is not available on PowerShell SDK.

This is not a bug but a limitation of the PowerShell SDK.

millicentachieng avatar May 19 '22 05:05 millicentachieng

thank you @millicentachieng

image

Other paths that do not generate snippets (could be related to exploded openapi issue where paths leading to the same resource were removed from the openapi desc doc. Affecting Go & powershell snippets - are the openapi based snippets): https://graph.microsoft.com/beta/me/insights/trending https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets('Sheet1')/usedRange https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets/Sheet1/tables https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets('Sheet1')/charts https://graph.microsoft.com/v1.0/groups/{group-id}/drive/items/root/children https://graph.microsoft.com/v1.0/me/drive/recent https://graph.microsoft.com/v1.0/groups/{group-id-for-teams}/drive/items/root/children https://graph.microsoft.com/v1.0/me/drive/root/children https://graph.microsoft.com/v1.0/me/drive/sharedWithMe https://graph.microsoft.com/v1.0/me/drive/root/search(q='finance')?select=name,id,webUrl

confirm if path is supported by powershell (not working for powershell only) https://graph.microsoft.com/v1.0/me/transitiveMemberOf/microsoft.graph.group?$count=true https://graph.microsoft.com/v1.0/identityProtection/riskyUsers?$filter=riskLevel eq 'high' https://graph.microsoft.com/v1.0/identityProtection/riskDetections https://graph.microsoft.com/v1.0/me/calendarview?startdatetime=2022-05-19T07:37:21.736Z&enddatetime=2022-05-26T07:37:21.736Z https://graph.microsoft.com/v1.0/me/calendarView/delta?startDateTime=2022-05-19T07:38:52.881Z&endDateTime=2022-05-26T07:38:52.881Z

adhiambovivian avatar May 19 '22 07:05 adhiambovivian

Adding more examples where the generation fails : GET /users/640885de-9652-4fb2-8a87-963cc2f599a0/photos/48x48/$value

GET https://graph.microsoft.com/beta/users/e436ca15-3a39-4dcc-819e-7dbb246cd46b/memberOf/microsoft.graph.administrativeUnit GET administrativeUnits?$select=id,displayName,description&$top=51 GET /groups/6565dae0-a004-4464-aedb-a41569bfdb59/photos/48x48/$value GET https://graph.microsoft.com/beta/users/e436ca15-3a39-4dcc-819e-7dbb246cd46b/memberOf/$/microsoft.graph.group?$select=id,displayName,mailEnabled,securityEnabled,groupTypes,onPremisesSyncEnabled,mail,isAssignableToRole&$top=20&$orderby=displayName%20asc&$count=true GET /groups/0a15764d-b8b5-462a-b7f0-f93e229ce246/transitivemembers/$count

RabebOthmani avatar May 26 '22 11:05 RabebOthmani

@adhiambovivian, @RabebOthmani PowerShell snippets for the following paths are now being generated

  • https://graph.microsoft.com/v1.0/identityProtection/riskyUsers?$filter=riskLevel eq 'high'
  • https://graph.microsoft.com/v1.0/identityProtection/riskDetections

These are not supported for PowerShell only

  • https://graph.microsoft.com/v1.0/me/transitiveMemberOf/microsoft.graph.group?$count=true
  • https://graph.microsoft.com/v1.0/me/calendarview
  • https://graph.microsoft.com/v1.0/me/calendarview/delta
  • https://graph.microsoft.com/beta/me/insights/trending

These paths are not generated in the Open API document and thus wont work for PowerShell and Go.

  • https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets
  • https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets('Sheet1')/usedRange
  • https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets/Sheet1/tables
  • https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets('Sheet1')/charts
  • https://graph.microsoft.com/v1.0/groups/{group-id}/drive/items/root/children
  • https://graph.microsoft.com/v1.0/me/drive/recent
  • https://graph.microsoft.com/v1.0/groups/{group-id-for-teams}/drive/items/root/children
  • https://graph.microsoft.com/v1.0/me/drive/root/children
  • https://graph.microsoft.com/v1.0/me/drive/sharedWithMe
  • https://graph.microsoft.com/v1.0/me/drive/root/search(q='finance')?select=name,id,webUrl
  • https://graph.microsoft.com/v1.0/groups/0a15764d-b8b5-462a-b7f0-f93e229ce246/transitivemembers/$count
  • https://graph.microsoft.com/beta/users/e436ca15-3a39-4dcc-819e-7dbb246cd46b/memberOf/$/microsoft.graph.group
  • https://graph.microsoft.com/v1.0/groups/6565dae0-a004-4464-aedb-a41569bfdb59/photos/48x48/$value
  • https://graph.microsoft.com/v1.0/administrativeUnits?$select=id,displayName,description&$top=51
  • https://graph.microsoft.com/v1.0/users/640885de-9652-4fb2-8a87-963cc2f599a0/photos/48x48/$value
  • https://graph.microsoft.com/beta/users/e436ca15-3a39-4dcc-819e-7dbb246cd46b/memberOf/microsoft.graph.administrativeUnit

We do have a gap in the Open API path generation where not all paths are created during the conversion from CSDL.

millicentachieng avatar Aug 08 '22 09:08 millicentachieng

Meanwhile, we do have this ticket on DevX API that will enable us to specify which paths, entities or singletons to skip for PowerShell only without affecting other Open API generated code snippets.

millicentachieng avatar Aug 08 '22 09:08 millicentachieng

@timayabi2020 can you have look at where we drop the navigationproperty for beta instances of users/id/insights/trending.

There are paths that should be expected to fail so we need to make sure we have the right experience around those expected failures. I don't think we should be skipping paths we should have the right experience or investigate the source of the failure like the one I've asked Tim to look at.

The other aspect of this is there's a gap between raptor validation and the total number of openapi paths. This means we can't validate all of this, so we need to look at Raptor can be run based off openapi paths instead of available docs only. @zengin

ddyett avatar Aug 11 '22 16:08 ddyett

@ddyett do we have a documented list of paths that powershell does not support by 'design' ? So far, I know that Powershell does not support /me paths and is this information available to users?

adhiambovivian avatar Aug 16 '22 13:08 adhiambovivian

Not supported for powershell beta version

  • [ ] https://graph.microsoft.com/beta/me/insights/trending. Issue raised here

Not supported for powershell

  • [x] https://graph.microsoft.com/v1.0/me/calendarview/delta
  • [x] https://graph.microsoft.com/v1.0/me/calendarview
  • [x] https://graph.microsoft.com/v1.0/me/transitiveMemberOf/microsoft.graph.group?$count=true

timayabi2020 avatar Aug 24 '22 21:08 timayabi2020

@millicentachieng I know you've been doing work on this on the DevX API side, what's the status ? @ddyett Do we want to change the label or anything on this issue? It has been around since August as a hotbug

RabebOthmani avatar Oct 12 '22 10:10 RabebOthmani