(no title)
mpetrovich | 3 years ago
There’s zero practical user benefit to NOT specifying the version, so why not enforce it? You’re creating a footgun otherwise.
Furthermore as others have pointed out, this is a purely cosmetic change. Using /api/$UNIQUE_STR in the URL vs. X-GitHub-Version: $UNIQUE_STR in the header are functionally equivalent, so…
Why bother making this change then? What was suboptimal about the previous way? What benefit does this bring?
EDIT: Serves me right for not reading the docs more carefully. From the docs [1]:
Requests without the X-GitHub-Api-Version header will default to use the 2022-11-28 version.
See phphphphp’s reply below for context.
[1] https://docs.github.com/en/rest/overview/api-versions?apiVer...
phphphphp|3 years ago
The benefit of this new versioning approach is that they can maintain backwards compatibility for existing implementations while introducing breaking changes for new implementations to benefit from.
In an ideal world, sure, they should have implemented this from the start, but they didn’t, so going forward they have to accommodate both existing implementations (by not breaking anything) and new implementations (by providing features that would break existing implementations).
They’re basically just implementing stripe’s well-understood and battle tested approach for versioning, while maintaining backwards compatibility. I am struggling to see any problems with the approach, in fact, it seems like the only right approach (?)
mpetrovich|3 years ago
That certainly addresses the footgun I mentioned.
EDIT: From the docs: Requests without the X-GitHub-Api-Version header will default to use the 2022-11-28 version.
timrogers|3 years ago
prepend|3 years ago
I work with a lot of APIs that just have “/v1” or “/v2” as part of the endpoint so it’s easy to specify. Setting a header parameter to a specific date is a PITA and I certainly don’t want to look up the curl syntax whenever I do simple work.
I think if they made it required, it would annoy people. So they didn’t.
mpetrovich|3 years ago
And it would annoy me far more if my app that talks to GitHub inexplicably breaks in a few years because of a release I wasn’t aware of.
These changes make no sense to me.
skeeter2020|3 years ago
Really? Don't you do this all the time for everything beyond a simple GET? From my experience it's far preferable than URL versioning because you can version on an individual endpoint. Right now I'm consuming Versions 0.9, 1.0 and 2.0 from a vendor; it would be way nicer to set individual headers than somehow mananging multiple endpoints.
RileyJames|3 years ago
I did a quick search and couldn’t see any docs on this use case.
pbreit|3 years ago
sitkack|3 years ago
I'll take the bait, like C++?
> comfortable making incompatible updates
Incompatible how? You specify the version, your semantics are of that version.
WorldMaker|3 years ago
The blog post suggests that we might find out some of the API changes that warranted this change as early as next month, but it would have been great for this blog post to include some examples of changes that were coming.
thrwawy74|3 years ago
I don't think it's a strong point.
MrStonedOne|3 years ago
[deleted]