News for hackers. Stuff that matters.
Re:RAML – RESTful API modeling language by danellis on Thursday September 10, 2015 @05:05PM (#10200559)
This completely misses the point of REST. By miles.

Why not just call it an "HTTP API modeling language", since that's what it is, instead of using buzzwords for the sake of it?

Re:RAML – RESTful API modeling language by SeldomSoup on Thursday September 10, 2015 @05:10PM (#10200581)
How does this miss the point of REST?
Re:RAML – RESTful API modeling language by danellis on Thursday September 10, 2015 @05:20PM (#10200635)
It describes how to construct URLs to get from one state to another (e.g. from a base URL to a list of songs, or from the list to an individual song). REST URLs are supposed to be opaque. A RESTful resource should provide links to its related resources for the user agent to navigate.

There's nothing wrong with what the author is trying to do, but it's nothing to do with REST.

Re:RAML – RESTful API modeling language by SeldomSoup on Thursday September 10, 2015 @05:54PM (#10200787)
Oops. That's one detail I missed in all those API tutorials. Thanks.
Re:RAML – RESTful API modeling language by danellis on Thursday September 10, 2015 @06:05PM (#10200852)
The canonical source is Roy Fielding's thesis, in particular chapters 5 and 6.

https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

Re:RAML – RESTful API modeling language by dragonwriter on Thursday September 10, 2015 @05:26PM (#10200660)
> How does this miss the point of REST?

Because if it didn't, the full API description language would be:

  api-root: <url>
Or, for a pedantically detailed version:

  api-root: <url>
  media-types: 
      - <media-type>
      - <media-type>
Re:RAML – RESTful API modeling language by tveita on Thursday September 10, 2015 @06:10PM (#10200880)
Devil's advocate: "api-root: http://example.org/foo.raml" fits that bill.
Re:RAML – RESTful API modeling language by muaddirac on Thursday September 10, 2015 @06:01PM (#10200830)
Sure, for consuming the API - but does RAML have to be used this way? Couldn't RAML be used to generate test expectations or even (with tooling that probably doesn't exist) actually generate the API itself?
Re:RAML – RESTful API modeling language by philwelch on Thursday September 10, 2015 @05:30PM (#10200688)
Are there any extant REST API's for which one could programmatically generate a client library based purely upon the root URL and media types?
Re:RAML – RESTful API modeling language by dragonwriter on Thursday September 10, 2015 @06:05PM (#10200842)
> Are there any extant REST API's for which one could programmatically generate a client library based purely upon the root URL and media types?

For a truly RESTful API, the question you ask is somewhat incoherent. A client for a RESTful API consists of two key sets of components: functionality for sending and receiving resource representations to and from locations identified by URIs, and functionality for handling resource representations of particular media types. Assuming you have those, you don't need to "programmatically generate a client library" with the particular base URL of a particular API root, you access a URL that provides resources of any of the supported media types and your off to the races without programmatically generating anything.

Is this possible in practice for real implementations of RESTful principles? Yes, including the one that motivated the articulation of the REST principles, the WWW.

Is REST appropriate for all APIs? Maybe, maybe not. But its probably not useful to anyone to just call every web service that uses HTTP and isn't SOAP "RESTful".

Re:RAML – RESTful API modeling language by sanderjd on Thursday September 10, 2015 @05:54PM (#10200784)
This is a great question. Any answers would be illuminating. I've largely given up on the idea of hypermedia APIs that work like this, because the mindshare and tooling just doesn't appear to be there for it. I've never seen a client library that is based on following rels from a root, rather than generating URLs based on out-of-band information.
Re:RAML – RESTful API modeling language by bct on Thursday September 10, 2015 @05:51PM (#10200773)