Releasing a set of test cases for Content Negotiation
This post's featured URL for sharing metadata is https://www.jvt.me/img/profile.jpg.
As I've written about in the past, I'm a big fan of using Server-Driven Content Negotiation for APIs for versioning, but also find it handy for being able to serve different representations of data depending on what the client supports. This is handy to be able to serve an HTML page to a browser doing a form-post, compared to JSON to an API client doing the same call.
However - and something I'm going to write about further in the future - is that doing it right is hard. Not only in how you implement the negotiation algorithm itself, but also making sure that all parts of your HTTP stack, including things like middleware, are aware of the different representations.
Because I want to make sure that I've got a separate record of the expected cases, as well as being able to help others building tools around content negotiation I've ended up creating a new repo, content-negotiation-test-cases.
I'll be looking to improve test cases, and see if there are clashes with well-known and supported frameworks.