News for hackers. Stuff that matters.
Re:How to Design Better APIs by hummingn3rd on Saturday March 12, 2022 @02:11AM (#30649580)
I really like this way of versioning https://medium.com/@XenoSnowFox/youre-thinking-about-api-ver...

It uses Accept and Content-Type to version resources: application/vnd.company.article-v1+json

Re:How to Design Better APIs by kortex on Saturday March 12, 2022 @09:08AM (#30651468)
That's...really clever, but at the same time, I feel like there's a lot of assumptions baked into how Content-Types are used, and making your own content-type for each data model when it's all just application/json seems...wrong to me on an intuitive level, but I can't quite annunciate why.

I only half agree with the sentiment that /api/v1 violates REST patterns. I don't think there's any guarantee that /api/v1/bars/123 can't be the same object as /api/v2/bars/123.

Re:How to Design Better APIs by BossingAround on Saturday March 12, 2022 @04:25AM (#30650186)
Interesting! Personally, if I had to go to the lengths of the article, I might as well use a schema registry like Avro.