Heracles.ts
Heracles.ts copied to clipboard
Decide on "hypermedia removal"
Should Heracle's remove hypermedia controls from the payload or not? If so, should it do so optionally? Or should this be done at a higher layer?
I think that Heracles should not remove hypermedia. I'd keep the representation as close as possible to the vocabulary to lower the barrier of entry. Principle of least astonishment and whatnot. IMO, removal should be up to another component it so desires.
Current implementation by default strips of the hypermedia controls from the original resource's payload, but this behavior is driven with a single bool flag which can be set to false as a default.
JsonLdHypermediaProcessor implemented now traverses the response and adds hypermedia to the separate object which is then framed so no other data leaks to the public API.
I'm OK with having a default behavior that leaves the hypermedia in the original payload. I can give it a try and just reframe the resource to obtain hypermedia (without traversing it) but publicly available objects will have non-hypermedia related stuff.