From Fielding's article (https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven):
A REST API should never have “typed” resources that are significant to the client. Specification authors may use resource types for describing server implementation behind the interface, but those types must be irrelevant and invisible to the client. The only types that are significant to a client are the current representation’s media type and standardized relation names. [ditto]
In HYDRA, classes can be documented in the API documentation like this:
supportedClass:
'@id': 'schema:Event'
supportedProperty:
- property:
'@id': eventName
Isn't it considered a typed resource? There is even a @type
field in JSON-LD. I understand the importance of standardized relation names, as they give clients the semantics, the format and constraints necessary to do useful stuff with the resource or property, however by limiting the range of possible relations in the API documentation, we are really declaring types (classes).
Without classes, clients won't know what relations will be present, and coding a client so it knows most relation types (e.g. from schema.org) isn't practical.
What is the exact meaning of this constraint, and how could it be useful in practice? Does HYDRA not respect this?
I'm asking this out of theoretical interest. In practice, I don't care if my HTTP API satisfies all constraints if it is usable.