Re: [Specifications] Requiring proper ranges on supported properties (#192)

Okay, I see your point but any kind of hard-coding introduces coupling. 

> This means those clients would already know how to handle schema:duration, without additional information in either the API doc or the vocabulary itself.

This is the definition of "out-of-band" information, which exists outside of the hypermedia controls. This comes at the cost of limited evolvability for the clients.

Of course, as @alien-mcl points out, it is theoretically possible to dereference the vocabulary and have client to the heavy lifting but it's hardly an options for the reasons I stated above.

> It appears to me, that data types would mostly be required by real generic clients that have no clue about the API domain at all.

Not necessarily. I mention API evolution. The more information the API provides explicitly (or are explicitly part of the media type's processing rules), the more resilient the clients will be to possible changes to the API. In other words, it should be harder to introduce breaking changes.

And such possible change could be switching one vocabulary for another, which should be transparent to the clients in most cases.

> The more complex it is to design a Hydra API the less likely it becomes that people adopt it.

Funny you should say that, because I think that the logic here is the exact opposite. See, requiring the range actually simplifies the overall Hydra experience IMO.

On one hand you add a property and call it a day.
The alternative is either to create coupling through hardcoded behaviours or introduce a whole lot more complexity to the clients (dereferencing and/or maintaining information about vocabularies).

And bear in mind that typically there is an N:1 relation between clients. Multiple clients are affected by a change on the server. If it's possible to have the server a bit more complex or strict to avoid that, it should be a default choice.

-- 
GitHub Notification of comment by tpluscode
Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/192#issuecomment-490544582 using your GitHub account

Received on Wednesday, 8 May 2019 15:56:49 UTC