api-guidelines
api-guidelines copied to clipboard
querying arbitrary number of keys in a dictionary insted
Hello team,
In the https://github.com/microsoft/api-guidelines/blob/vNext/graph/patterns/dictionary.md, it mentioned that the keys must be defined by the client. However, there were only examples for client to specify a single key (by appending it in the path). What if the client is interested in multiple keys? Do we have an example on what the request should be?
You should be able to use $select to retrieve values for multiple keys. Here is an example:
Request:
GET /users/10/assignedRoles?$select=author,architect
Response:
{ "author": { "domain": "contoso" }, "architect": { "domain": "adventureWorks" } }
In the future, we will update the pattern as well. Thank you for your suggestion.