Live data from Hacker News

What it means for an API to be RESTful

en.andros.dev

31–40 of 59 posts

Re: What it means for an API to be RESTful

#31
post #20

Earlier quoted context omitted.

GET, COMMENT, PUT, UPDATE, DELETE. Yeah, makes sense. Now we only need an alternative for PUT to backcronym CRUD. RIPOSTE?

I was referring to that the PATH could just be named /api/comment?... , because comment is already a verb.

This is exactly the kind of pointless discussion around rest apis

Re: What it means for an API to be RESTful

#32
post #20

Earlier quoted context omitted.

GET, COMMENT, PUT, UPDATE, DELETE. Yeah, makes sense. Now we only need an alternative for PUT to backcronym CRUD. RIPOSTE?

I was referring to that the PATH could just be named /api/comment?... , because comment is already a verb.

URIs/paths are meant to point at resources/documents and therefore ideally should not contain verbs.

Re: What it means for an API to be RESTful

#33

Many years ago as a young developer I read Fielding's dissertation, Fowler's writings on the Richardson Maturity Model and even a book (don't remember the title) on the topic. Then I spent the next dozen years creating, reading, updating and deleting JSON APIs. Problem Details (RFC 9457) are useful and have made an occasional appearance, but actual hypermedia driven APIs with custom media types seem to be non-existen…

> I do still have an aesthetic appreciation for "true REST", but in practice I find the fact that nobody uses it to be mainly useful in ending bikeshedding discussions. Once you understand your API isn't RESTful to begin with, there's no longer any point in arguing if 411 or 412 is the more RESTful status code to use when a user attempts to order a product without specifying a quantity.

I think I have a fundamental objection to the idea that Fielding and Fielding alone got to decide what REST is. While there hasn't been any kind of formal counterproposal, in some sense REST is what we make of it. Re: http 400 codes, I think many of us really liked the general principle of "use http semantics!" and applied that to error codes as well. That's agreeing with the principle and extending it in new ways that we like and are "truer" to the principle, even if it wasn't intended.

In my mind this is sort of analogous to talking about the relationship between linux and unix. Linux is clearly not a genetic or copyright unix, but I've seen it said before that linux is the culmination of unix principles, in some cases extended beyond what was originally envisioned in ways that are innovative and genuine improvements (io_uring perhaps?).

The REST we have today - http semantics, specific error codes, etc - may be significantly different from what Fielding may have wanted, but IMO it implements the parts that really distinguish it from the RPC world of API architecture, and I think we're generally happy with that.

Re: What it means for an API to be RESTful

#35

Earlier quoted context omitted.

I was referring to that the PATH could just be named /api/comment?... , because comment is already a verb.

URIs/paths are meant to point at resources/documents and therefore ideally should not contain verbs.

The word comment can be both a verb and a noun though. Are we pedantic enough yet? (:

Re: What it means for an API to be RESTful

#37

REST seems to bring out people who like to define specs and correct others on following the spec or not. There are many other things in tech like this. To be honest, I just kind of don't understand the point. Could my API be better following some of these rules the author presented? Probably. But by how much? Is it worth it? When someone else on my team disagrees do we go back and argue about the spec again? After 12…

> REST seems to bring out people who like to define specs and correct others on following the spec or not. There are many other things in tech like this.

Yes, and this blog post is exactly yet another example. Some of the blogger's points are blatant violations of REST, such as the comments on URIs and api versioning. Yet, the blogger elevates their own personal misconceptions to the status of one true RESTful way.

Ultimately it's all mostly irrelevant. All it matters is that the contract is specified and preserved and clients can consume services through a specific interface. Furthermore the pervasive use of openapi specs already crystalize the RPC approach to interfaces.

Re: What it means for an API to be RESTful

#38

REST seems to bring out people who like to define specs and correct others on following the spec or not. There are many other things in tech like this. To be honest, I just kind of don't understand the point. Could my API be better following some of these rules the author presented? Probably. But by how much? Is it worth it? When someone else on my team disagrees do we go back and argue about the spec again? After 12…

I try not to blame the 'Roy Fielding is right' camp on this. I also try not to blame the "terminology doesn't matter' camp.

There are groups of people using the same terms for different things, and getting into arguments where there could be agreement.

There's a diverse set of people on the spectrum between formally trained and self taught people in software development. Terms can get borrowed from places like academic research and get (mis)applied before they are understood.

The REST in industry software is essentially JSON RPC (no, not that one) mapped to HTTP methods. That's a mouthful, so people just say RESTful, despite it not quite being RESTful according to the original notion of REST.

Yes, industry-RESTful isn't necessarily RESTful according to original Roy Fielding definition, but trying to redefine a widely used industry term is unlikely to win one friends at dinner parties.

Re: What it means for an API to be RESTful

#39
REST is an inherently human technology, almost superfluous for API(emphasis on Programming Interface) usage. I guess it does not strictly have to be, especially with our modern LLM's But REST can best be summed up as "ship the human interface required to handle a state with every state". For a strictly programming interface, this interface coupled with the state is inefficient and mostly pointless(the application already knows how to handle the state, it does not have to figure it out) and is better served by a more focused mechanical transfer.

With how narrow this scope ends up being I can understand how most of the tech industry collectively had what appears to be a collective brain fart when Fielding said "hey this web thing is doing something really novel in the field of application design, lets talk about it" and went "herp derp, REST == HTTP, sounds good to me". I mean I understand it, but still find it funny.

Re: What it means for an API to be RESTful

#40

Many years ago as a young developer I read Fielding's dissertation, Fowler's writings on the Richardson Maturity Model and even a book (don't remember the title) on the topic. Then I spent the next dozen years creating, reading, updating and deleting JSON APIs. Problem Details (RFC 9457) are useful and have made an occasional appearance, but actual hypermedia driven APIs with custom media types seem to be non-existen…

I had flashbacks to when I first started making web apps. I used to care so very much about this. I haven’t thought about capital REST in years.

Edit: a few minutes after I wrote that I had the thought, what if this is someone else’s arc with AI code. A lot of people seem to care a whole awful lot right now. A decade time horizon is interesting to think about.

Post reply on HN