As outlined in #9, json:api allows fetching a related object via /:type/:id/:field_name and the relationship itself via /:type/:id/relationships/:field_name. This PR implements optionally fetching related objects and relationships using these endpoints via parallel requests.
In order to test this, I needed to mock up fetching these smaller subsets of data, so the rudimentary JSON file would not cut it. An API mocking function takes a request object and uses the file system to construct a json:api-compliant response. It supports relationships via query string parameters and via the URLs specified above.
As outlined in #9,
json:api
allows fetching a related object via/:type/:id/:field_name
and the relationship itself via/:type/:id/relationships/:field_name
. This PR implements optionally fetching related objects and relationships using these endpoints via parallel requests.In order to test this, I needed to mock up fetching these smaller subsets of data, so the rudimentary JSON file would not cut it. An API mocking function takes a request object and uses the file system to construct a
json:api
-compliant response. It supports relationships via query string parameters and via the URLs specified above.This is best reviewed on a per-commit basis.