News for hackers. Stuff that matters.
Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by iio7 on Wednesday August 17, 2022 @11:12PM (#32504825)
You're missing the point. If you provide an API like in the example you give, put it out on the net at some domain, then in order for it to be REST, I MYST be able to access that domain, without any prior knowledge whatsoever, and make a request.

When I do that in the case you provide, I would not know anything about how to use those resources. Without any prior knowledge, I don't know what "users" are, or what a "like" is or an "unlike". In order for me to use this resource, I need documentation. Even if you provide the documentation in the response to the request, and I have to read that first, then it is NOT REST.

By the very nature of an API, it can never be REST.

Re:Ask HN: Anyone here switch to Go for building (REST) APIs? by bern4444 on Thursday August 18, 2022 @10:39AM (#32510299)
Okay, I understand the distinction but as I said, it seems to be a distinction without a difference.

The idea of REST has evolved beyond the initial definition to include a broader and far more impactful meaning. The abstraction of UI over data. The important piece is the data.

I could make an entire website, entry point and all that only returned json and included the links for actions users could take and other pages they could visit. Whether I use a browser to see that or my terminal with a cURL makes no difference.