Roy Fielding himself had an interesting interview [0] where versioning a REST API was one of the topics (spoilers: version is not in the url nor headers).
[0]: https://www.infoq.com/articles/roy-fielding-on-versioning/
[0]: https://www.infoq.com/articles/roy-fielding-on-versioning/
I think Rich Hickey (the creator of Clojure) would agree. He said something to this effect in the "Spec-ulation" keynote at Clojure/conj 2016. https://www.youtube.com/watch?v=oyLBGkS5ICk
The hostname thing might work for huge, world-changing re-writes, but for small, incremental changes, I think something like what GitHub does w/ the Accept header is far more appropriate.
[edit: ...and resources. And be able to comprehend resource record conventions]
I just don't see any generic operations w.r.t. discovery that are … useful.
I'm not trying to say that you shouldn't, e.g., use URLs in your resulting resources; e.g., if a query for a widget returns:
{
"widget_name": "NextGen Enterprise Widget",
"suppliers": "http://bigcorp.example.com/widget/123/suppliers"
}
That's fine. But you're still going to need to know how to parse the result of …/suppliers, or it's just opaque bytes.