api-guidelines icon indicating copy to clipboard operation
api-guidelines copied to clipboard

querying arbitrary number of keys in a dictionary insted

Open dxynnez opened this issue 2 years ago • 1 comments

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?

dxynnez avatar Sep 20 '23 13:09 dxynnez

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.

OlgaPodo avatar Oct 02 '23 21:10 OlgaPodo