Hacker News new | ask | show | jobs
by ksahin 2529 days ago
"After 4 and a bit years, by far and away the most popular method with an uptake of more than 90% is versioning via the URL. So that's all V3 supports. I don't care about the philosophical arguments to the contrary, I care about working software and in this case, the people have well and truly spoken. I don't want to have to maintain code and provide support for something people barely use when there's a perfectly viable alternative."

Well said !

1 comments

Funny thing is here I am wondering why he didn't pass a query parameter instead of altering the path or adding a header to version the API... does anyone know? It has the advantage of being clickable while not implying the resource is different.
One reason could be constructed by example, as:

  <Location /v3>
vs.

  <LocationMatch ?[.*&]v=3(&|$)>
Which is to say that, depending on the application's coincidental design and structural choices over time, managing versions at /v1 /v2 /v3 might well be vastly easier for the "shoestring budget" operator than at /?v=1 /?v=2 /?v=3.
It seems unlikely considering the other 3 were more drastically different and yet seen as pretty equally easy.
API versioning with query parameters is often an implementer nightmare.
Why..? Does it break through too many abstraction layers?
one benefit of putting version in the path is it makes it easier for loadbalancers to direct traffic. like v3 could be served from different servers than v2
Why can't they do that with the query parameters?
maybe he can, but I know that google cloud's loadbalancer doesn't let you.