Nested Resource URL Paths and Relationship Links

David Tang · Apress eBooks · 2020

Many APIs use nested resource URL paths to express relationships. An example of a nested resource URL path is /contacts/1/pets, where the collection of pet resources returned from this endpoint belongs to the contact resource with an id of 1. These endpoints are often referred to as relationship links, and Ember Data knows how to use them to load relationships. Let’s look at the default behavior of how Ember Data uses relationship links in response payloads. Then, we will look at how to tell Ember Data about relationship links if they aren’t present in an API.

Read the paper · More papers on PaperTik