mercredi 22 avril 2015

How to version my API with Spring MVC?

For now, URLs of my API are for example:

/api/users

With Spring MVC:

@RequestMapping("/api/users")

I would like to version this api:

/api-v1.0/users

The best would be to be able to use an SpEL in the @RequestMapping annotation, but it is unfortunately not possible:

@RequestMapping("/api-#{appProps['version']}/users")

What are the other options then?

Aucun commentaire:

Enregistrer un commentaire