Skip to content

URL built by the SDK doesn't match with the URL expected by the service #1156

Closed
@zengin

Description

@zengin

Original HTTP snippet from the docs

GET https://graph.microsoft.com/v1.0/identityGovernance/accessReviews/definitions/filterByCurrentUser(on='reviewer')

C# Snippet:

GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var filterByCurrentUser = await graphClient.IdentityGovernance.AccessReviews.Definitions
	.FilterByCurrentUser(AccessReviewScheduleDefinitionFilterByCurrentUserOptions.Reviewer)
	.Request()
	.GetAsync();

When executed, the URL becomes:

https://graph.microsoft.com/v1.0/identityGovernance/accessReviews/definitions/microsoft.graph.filterByCurrentUser(on=Reviewer)

And the service returns the following error:

{
    "error": {
        "code": "BadRequest",
        "message": "The parameter 'on=Reviewer' is not in scope.",
        "innerError": {
            "date": "2021-10-22T00:33:40",
            "request-id": "d6262272-9b0e-455e-a081-726be78e7b60",
            "client-request-id": "2f0a0d8a-626f-f9ec-f543-98f36c191681"
        }
    }
}

Following two changes don't make a difference:

  • Fully qualified function name microsoft.graph.filterByCurrentUser vs filterByCurrentUser
  • PascalCase vs camelCase i.e. Reviewer vs reviewer.

Service works fine if the quotes are present.

@andrueastman @MIchaelMainer, I haven't had a chance to dig into the OData spec for this. Do you know whether

  1. the URL we generate should be allowed by the spec and service needs to be fixed or
  2. should we fix our URL builder in the SDK?

cc: @darrelmiller @baywet

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions