Add support for $expand=owners($select=foo,bar,baz)

Add support for $expand=owners($select=foo,bar,baz)
0

Upvotes

Upvote

 Jun 25 2021
0 Comments 
New

I like to get owners from an applications like:

 

GET https://graph.microsoft.com/v1.0/applications?$filter=startswith(displayName, 'MyApp')&$select=displayName&$expand=owners($select=userPrincipalName)
Content-type: application/json
ConsistencyLevel: eventual
Authorization: Bearer {{GraphToken}}

 

assert:

 

    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications(displayName,owners($select=userPrincipalName))",
    "value": [
      {
        "displayName": "MyApp",
        "owners": [
          {
            "@odata.type": "#microsoft.graph.user",
            "userPrincipalName": "MyUserPrincipalName"
          }
        ]
      }
    ]
  }

get:

{
  "error": {
    "code": "Request_BadRequest",
    "message": "Invalid $select properties.",
    "innerError": {
      "date": "2021-05-22T14:31:22",
      "request-id": "2e08e83c-c18a-4202-9d98-4c5021d67167",
      "client-request-id": "2e08e83c-c18a-4202-9d98-4c5021d67167"
    }
  }
}

 

GitHub