I'm working on a small spring mvc project which requires to add api version to the request urls for example: http://host.serice.com/api/1.0/documents
. As my understanding i can implement like this:
@RestController
@RequestMapping(value="/api/1.0")
public class DocumentController {
}
In my opinion, it's not a good idea because i have to hard code the version number to all controllers, once the version number increase i have to reupdate the controllers again, this work may violate "open for extension closed for modification" principle. Do you have any idea for this ?