Currently working on improving a service for product information. One facet that is causing some discussion is around associating asset to a product - like images or instruction manuals.
We do have a separate service that handles such files and current we crate relationships to those using a relationship object:
{
"files": [{"data": {"type": "files","id": "anID"}},...]
}
These assets can be managed within the system and included in responses…
We are looking at allowing external files to be related to an entity, from a CDN or such forth that we do not have any control over.
Initially we thought of the validity of using a links object as the relationship - but this appears to be invalid as per the specification but something like:
{
"files": [
{"data": {"type": "files","id": "anID"}},
...,
{"link": { "href": "path_to_external_resource"}}
]
}
Looking for suggestions as to how to relate external resources - if it is even valid - or should we look to use meta data on the entity to achieve such things.