Live data from Hacker News

Introspected REST: An Alternative to REST and GraphQL

introspected.rest

51–60 of 64 posts

Re: Introspected REST: An Alternative to REST and GraphQL

#51
Hi, author here. AMA. But I would like to make a couple of points.

For starters, a lot of people are looking for a TL;DR. There is no such thing. Same with tooling.

This is an open publication and should be considered as is. The intention was to come up with a better architectural design than REST, reusing existing Internet architecture. And that was the real challenge. Because REST and HTTP have been built almost by the same person. Bending existing Internet architecture to fit another architectural style for networked services is extremely difficult, but apparently not impossible.

GraphQL for instance, uses HTTP just for the transport layer. That's a big assumption to make there, anyone can build very flexible stuff if you are about to re-design everything HTTP gives on top of HTTP.

Another note is the reason that it takes so much time to get to the actual model (section 9) is to make sure the reader understands what is REST and where REST fails. And I haven't really seen any other document/publication explaining REST so extensively. So for those who are complaining that none gives a definition of REST, then go through section 1-6 and you should have it.

Last but not least, Introspected REST is compatible with existing REST architecture, it just makes it more robust and flexible. So for the tiny hello world example, it doesn't really make any difference other than exposing some meta data through the OPTIONS endpoint, like the (JSON) schema and the linking. But for complex APIs it should give huge advantages compared to REST.

And again: this is an open publication. From that to actual implementation there are many steps needed to be taken (for starters defining the necessary microtypes).

Re: Introspected REST: An Alternative to REST and GraphQL

#52
post #46

Also submitted a couple months ago. Only got a few comments back then: https://news.ycombinator.com/item?id=15211604 The first sentence of TFA captures one of the most annoying things about REST discussions: "In this manifesto, we will give a specific definition of what REST is, according to Roy, and see the majority of APIs and API specs (JSONAPI, HAL etc) fail to follow this model." At this point I've read or heard…

Author here: The problem with GraphQL is that it has to re-invent everything on top of HTTP. Introspected REST reuses HTTP properties and architecture by default, making more robust and compatible with existing clients. Also related: https://news.ycombinator.com/item?id=18425581

Re: Introspected REST: An Alternative to REST and GraphQL

#53

There is some good stuff in here, but it misses the biggest pain point developers face when trying to make a robust hypermedia API: tooling. There is a lack of tooling on the server side and almost no tooling on the client side. The amount of effort required to serve a RESTful API requires a lot of upfront investment. Then convincing the client developers to take advantage of the hypermedia affordances requires a lot…

Hi, author here. That was one person publication so tough to come up with tooling as well :)

I think we just wanted to show that it is possible to come up with a different (better we think) architecture other than REST and that's a big thing I think. Relevant answer: https://news.ycombinator.com/item?id=18425581

Re: Introspected REST: An Alternative to REST and GraphQL

#54

I never understood why people love REST. Just use some kind of JSON-RPC, or something like that. In my experience most of so-called "REST" interfaces are just poorly written RPC. Some people even think that REST means HTTP + JSON. It's extremely rare to encounter a true REST interface with e.g. HATEOAS, proper caching, etc. And if many developers can't utilize technology, probably technology is not good enough to be…

If you are talking to devices that you can't even access/control, REST is a better way of interacting with the sensors. RPC is out of the question because it tights implementation with the API. However if you talk to a client that you can control, it's up to you, if you want to use RPC then it's fine.

Re: Introspected REST: An Alternative to REST and GraphQL

#55
post #45

Kudos to the author for going the extra length of trying to maintain semantic interoperability and reuse by showing how to be backwards compatible with e.g. JSON-LD. This makes it possible to continue to build upon all the vocabularies already created.

Thanks! That was the real challenge!

Re: Introspected REST: An Alternative to REST and GraphQL

#56
post #14

REST allows for clients and servers to evolve independently. If you can constrain that you can probably design something significantly simpler. That’s not a shortcoming of REST, though. The channel between your mobile client and your backend would probably be better served with something more like RPC than academic REST.

That's our proposal/challenge here, come up with a model that tries to merry the best of both world (RPC and REST) but still adheres to HTTP semantics and allow clients/servers to evolve independently.

Re: Introspected REST: An Alternative to REST and GraphQL

#57
post #41

It looks like the meat starts at section 9. - Sections 1-8 are a summary of REST, HATEOS, their problems, and reflections on the problem that every endpoint is `application/json` and not something more specific to the intended use case. - Sections 9-11 discuss a variant of REST that doesn't use Media Type differentiation for capabilities, but rather composable nuggets of semantics called MicroTypes. The MicroType sch…

I think the best argument the author could have made is an example. If a proposal like this cannot be illustrated in an example (like it can be done for REST or GraphQL), it's likelihood of adoption is going to be low...

What I got out of it... REST as practiced now is bad. To find out how to make it good, read this 40 page manual. I prefer to use the system that doesn’t require long form specification reading.

Re: Introspected REST: An Alternative to REST and GraphQL

#58

Earlier quoted context omitted.

This is definitely interesting and I will spend some more time checking this out. This tooling looks more advanced than pretty much anything else out there, but from what I can tell it is a server-side driven approach. I have been trying to imagine what tooling that is client-side first looks like. It should not matter _how_ a server implements something, such as Siren, only that it properly follows the semantics of…

It can be server driven, but it doesn't have to be. It depends where the data is and what the permissible access patterns are and which process is responsible for enforcing them. These days the data that matters is in server-side databases with tightly controlled access patterns so it is pretty weird for the client to be in charge. Hyperfiddle's data protocols are sufficiently abstract to run anywhere in the continnu…

Wow, this is really interesting. Wish I worked on it!

What tech and languages do you guys use? And are you hiring?

Re: Introspected REST: An Alternative to REST and GraphQL

#59

It looks like the meat starts at section 9. - Sections 1-8 are a summary of REST, HATEOS, their problems, and reflections on the problem that every endpoint is `application/json` and not something more specific to the intended use case. - Sections 9-11 discuss a variant of REST that doesn't use Media Type differentiation for capabilities, but rather composable nuggets of semantics called MicroTypes. The MicroType sch…

> reflections on the problem that every endpoint is `application/json` and not something more specific to the intended use case.

This is a feature, not a bug. If a JSON decoder can interpret the format, then it is by definition `application/json`. The alternative is to go back to miriads of incompatible data exchange formats, and each dev writing his own buggy parser, or installing yet another dependency to his application.

Re: Introspected REST: An Alternative to REST and GraphQL

#60

It looks like the meat starts at section 9. - Sections 1-8 are a summary of REST, HATEOS, their problems, and reflections on the problem that every endpoint is `application/json` and not something more specific to the intended use case. - Sections 9-11 discuss a variant of REST that doesn't use Media Type differentiation for capabilities, but rather composable nuggets of semantics called MicroTypes. The MicroType sch…

Not sure if this allows clients to compose a server-provided selection of middleware, or if it allows them to provide completely custom middleware?

If it's the latter, as well as performance I'd be deeply concerned about security.

Post reply on HN