23 ms·
This is right on the money in identifying the continual battle with using a hypermedia API for system-to-system communication. There comes a time where you rea
by peeters 4y ago
This is right on the money in identifying the continual battle with using a hypermedia API for system-to-system communication. There comes a time where you realize that what you're building is great for discoverability, but not for instructing a computer to do something on your behalf.
That said, the situation isn't entirely dire. With some standard linking conventions (e.g RFC 8288 [1]), you can largely make an API that is pleasant to interact with in code as well. That the links/actions are enumerated is good for humans to learn how to manipulate the resource. That they have persistent rels is good for telling a computer how to do the same.
Think <link rel="stylesheet" href="foo"> as an example. A human reading the HTML source will see that there's a related stylesheet available at "foo". But a program wanting to render HTML will check for the existence of links with rel="stylesheet".
1: https://datatracker.ietf.org/doc/html/rfc8288#section-2.1.2 https://datatracker.ietf.org/doc/html/rfc8288#section-2.1.2