News for hackers. Stuff that matters.
Re:API design: Which version of versioning is right for you? by wellpast on Sunday October 06, 2019 @05:35PM (#21175334)
Or no versioning.

Create new endpoint URIs for new semantics.

Use vocabulary-based (property-based) entities and never change word (property) semantics.

Contrary to its unpopularity (or because of?), this “strategy”* is far far simpler to maintain and evolve than is “versioning”.

*I say “strategy” because this is more commonsense: it’s how we do things in the real world anyway.

Re:API design: Which version of versioning is right for you? by braindeath on Sunday October 06, 2019 @05:47PM (#21175395)
I think this is still versioning. You just end up versioning with the endpoint URI. Eg many names that end -2 or -3.
Re:API design: Which version of versioning is right for you? by wellpast on Sunday October 06, 2019 @06:08PM (#21175495)
If the semantics change, why do you need a “-2”?

If the semantics don’t change, why do you need a new URI.

Keep in mind you don’t have to focus on the suffix or the last part of the path name when you are naming things by URI.

Also, why is it versioning? You have two endpoints in use. One happened to exist before the other one. That’s an incidental property. And there are scenarios where you may deprecate the latter before the former.

Thinking in “versions” is not an accurate/ergonomic mapping of the domain anyway; we’ve just been tricked into thinking that way because... anthropology something.

Re:API design: Which version of versioning is right for you? by antonvs on Monday October 07, 2019 @02:17AM (#21177995)
> If the semantics change, why do you need a “-2”?

Because the API may serve the same purpose as the original, with some modified semantics.

> Also, why is it versioning?

Because the API may serve the same purpose as the original, with some modified semantics.

Sharing a common name with versioning helps identify the relationships between the versions. It also avoids polluting the API namespace with a set of different names for different versions of essentially the same operations.

> Thinking in “versions” is not an accurate/ergonomic mapping of the domain anyway; we’ve just been tricked into thinking that way because... anthropology something.

It feels to me like you're trying to hard to be contrarian, or perhaps you're dealing with some special case scenario where your strategy makes sense.

You'd need to explain the argument in significantly more detail to have a chance of making it convincing.

Re:API design: Which version of versioning is right for you? by wellpast on Monday October 07, 2019 @10:12PM (#21188003)
See the link to Rich Hickey’s talk in my other comment. It covers the issues pretty well.

I’m not being contrarian, but I am expressing frustration with a common yet unnecessarily complicated approach to a general problem. But I stand by my statements, they’ve paid off tremendously in real world contexts.

Re:API design: Which version of versioning is right for you? by chrisweekly on Sunday October 06, 2019 @05:51PM (#21175419)
Could you please give an example of these property-based entities, or link to an API that follows this approach? I think I understand your suggestion but want to be sure. New endpoints for new semantics seems rock-solid to me along same lines as content-addressable / immutable build artifacts which I endorse.
Re:API design: Which version of versioning is right for you? by wellpast on Sunday October 06, 2019 @06:04PM (#21175478)
Rich Hickey explains a similar thinking in this talk https://youtu.be/oyLBGkS5ICk but it’s more directed at code libraries. The same arguments apply.

I 100% think this is the way to go for internal APIs.

For public APIs I may change my opinion here for more sociological/political reasons. The rational/technical reasons all still remain.

Re:API design: Which version of versioning is right for you? by chrisweekly on Sunday October 06, 2019 @08:51PM (#21176330)
Thanks! Helpful link, and args simply / well-put. :)