HydraCG / Heracles.ts

Reference implementation of a Hydra client in TypeScript
https://hydracg.github.io/Heracles.ts/
MIT License
36 stars 16 forks source link

Revisit extraction of "hypermedia" from resources #22

Open lanthaler opened 6 years ago

lanthaler commented 6 years ago

Currently Heracles extracts things like operations into a hypermedia property. The proposal is to either use hydra instead or directly use Hydra terms like member.

The reason I don't like hypermedia is because it is the combination of the controls and the information etc. This comment from Roy T. Fielding probably describes best what I want to say: http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven#comment-718

When I say hypertext, I mean the simultaneous presentation of information and controls such that the information becomes the affordance through which the user (or automaton) obtains choices and selects actions.

What we try to do here is to extract the controls out of the hypertext/hypermedia.

I thought about controls too but things like controls.member don't seem to make too much sense. Since this is the Hydra reference client, I wouldn't be too worried about using the term hydra for this.

elf-pavlik commented 6 years ago

I thought that we could make enriched resource a primary one and from there allow access to the original response payload with something like .rawPayload