msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

The origin property in PermissionScope cannot be set

Open JesperLeerberg opened this issue 1 year ago • 3 comments

Describe the bug If you set this property and send it to the graph you will get an error. Not setting this or having null works. The graph Docs does not have this property in their docs. I assume it depends on what the backend API consumes.

To Reproduce Update an application registration with the new scope where the model PermissionScope has the Origin property set to e.g. "Application".

Expected behavior HTTP/1.1 204 No Content

Screenshots https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/bee6cabf551d4cddd066d31101892423dd659a8c/src/Microsoft.Graph/Generated/model/PermissionScope.cs#L52

Graph docs: https://docs.microsoft.com/en-us/graph/api/resources/permissionscope?view=graph-rest-1.0

SDK version: 4.35.0

JesperLeerberg avatar Aug 31 '22 11:08 JesperLeerberg

Thanks for raising this @JesperLeerberg

We generate the client library from https://graph.microsoft.com/v1.0/$metadata and the property is present as shown below. Unfortunately, the metadata does not give info on whether a property can or cannot be set.

image

Any chance you can share more information on the exact error you receive when you set the property (error message and client-request-id) to help feedback to the relevant API team?

andrueastman avatar Sep 05 '22 09:09 andrueastman

Sure, here is the error that the graph returns.

Code: Request_BadRequest Message: Expected property 'origin' is not present on resource of type 'PermissionScope' Inner error: AdditionalData: date: 2022-09-05T13:38:19 request-id: cf3c9b0a-807e-46c0-bbf9-262ab34dba7d client-request-id: cf3c9b0a-807e-46c0-bbf9-262ab34dba7d ClientRequestId: cf3c9b0a-807e-46c0-bbf9-262ab34dba7d

JesperLeerberg avatar Sep 05 '22 13:09 JesperLeerberg

API team has acknowledged this is a bug and have created https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2059105 to track and fix.

andrueastman avatar Sep 07 '22 04:09 andrueastman