microsoft / microsoft/api-guidelines
Request for additional guidelines for nested/embedded collections
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 23.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
Currently, the guidelines mention the URL structure for nested collections within a resource:
GET https://api.contoso.com/v1.0/people/123/addresses
The guidelines also mention that paging semantics should be consistent between the parent and any nested collections.
However, there are some important details missing for ensuring a consistent experience that I'd like clarification on:
- How does the API indicate to a developer that a resource contains a nested collection? In the example above,
addressesis out-of-band information. If the original collection query returnsaddressesdata, how is it represented?
For example::
- Similar to @nextLink, @deltaLink, or @added, it could provide a reference merely referring to the JSON path from which to query the nested collection.
- It could be a partial set (but then, this begs the question of how the query URL structure would handle the paging semantics for this, and seems not ideal if the developer doesn't want to pull an arbitrary number of nested records on each query only as a way of indicating they exist)
- It could come via Link relations in a header
- It could come through an OPTIONS call to the parent resource
It seems like the guidelines are leading us to keeping nested collections on their own discrete resource path without the additional complexity of "dot notation" in query semantics to indicate nested paths, or similar, but it's not clear how we're meant to expose the existence of the nested collections themselves.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Guidelines.md section 9.3.1, “Nested collections and properties,” and review its URL structure and paging guidance alongside the examples and alternatives listed in this issue. Done means the guidelines clearly explain how clients discover nested collections and how their representation and paging semantics should work.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100