News for hackers. Stuff that matters.
Re:Problems with Swagger by richardwhiuk on Tuesday April 04, 2017 @04:42PM (#14037001)
If I remove the reference to a link in the response, it doesn't remove the clients need to:

a) know how to retrieve that link (i.e. what resource do I need to retrieve in order to get that response)

b) requirement for that link to exist (they still need that link).

Requiring that a client know that to get data Bar, they need to retrieve resource A, follow the link at foo[n]._link to retrieve resource B, and then following the link at _link.bar feels like a total non starter, and actually increases coupling.

Re:Problems with Swagger by eterps on Tuesday April 04, 2017 @04:54PM (#14037103)
I am not sure I get your example. But yes the client still has to know what to do in advance.
Re:Problems with Swagger by edmccard on Tuesday April 04, 2017 @06:28PM (#14037838)
>But yes the client still has to know what to do in advance.

According to Roy Fielding[1] (who came up with the concepts of ReST and HATEOAS:

"A REST API should be entered with no prior knowledge beyond the initial URI (bookmark) and set of standardized media types that are appropriate for the intended audience"

So if an application doesn't rely on "standardized media types", and "the client still has to know what to do in advance", then it seems like whatever you're doing, it isn't HATEOAS after all.

[1] http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hyperte...

Re:Problems with Swagger by kelnos on Wednesday April 05, 2017 @01:04AM (#14039804)
I don't think you and your parent mean the same thing. The client "has to know what to do in advance" in the sense that the human building the application needs to know what user interface they want to build, and know how the API works (in advance) in order to use it to populate the interface.

If you have an extremely dumb interface that just displays fields in API responses, then ok... but that's a very trivial UI that accounts for... basically no useful products ever.