Geane Norm wrote:Another very trivial question I have is, when you implement API Versioning, do you solely do for GET requests or is it also extended to POST, PUT and DELETE requests?
Stephan van Hulst wrote:I don't know about libraries to do content negotiation, but why would you need one? Can't you just annotate different versions of methods with different @RequestMapping annotations that have the consumes and produces properties configured differently? Something like this:
I'm not a fan of using the Content-Type and Accept headers for this approach though. I'd rather use a custom headers. You can do this with the headers property of the various @RequestMapping annotations.
Geane Norm wrote:Another very trivial question I have is, when you implement API Versioning, do you solely do for GET requests or is it also extended to POST, PUT and DELETE requests?
If you're doing it for GET, then why not for the other verbs? What makes them special?
Geane Norm wrote:My main doubt resides in what the @RequestMapping should have as opposed to the @GetMapping (for example).
and at the level of each @GetMapping: