how should I change the representation (not mimetype) of a resource?
- by xenoterracide
I'm looking at how I can change the representation of a payload at runtime for varied potential advantages, but I'm not sure how to do it. Specifically collections.
Array of Pairs
[{ <resource_uri> : { <entity> }, ...}]
Array of Objects
[<entity>,...]
Array of Resources
[<resource_uri>]
Map of entities
{ <resource_uri> : { <entity> }, ... }
My problem is, I'm not sure if I should put these different representations of the sets at different URI's, give them slightly varied mime types, e.g. application/foomap+json or perhaps use an optional query parameter ?format=map, or resource /entities/map. The UI is going to hide this, this is for programmatic web service access only (which the "UI's JS will have to call).