Skip to content

Handle @RequestMapping at package level [SPR-15913] #20467

@spring-projects-issues

Description

@spring-projects-issues

Stéphane Daviet opened SPR-15913 and commented

I would like to manage the version of my REST API in the URL, something like v1/my_resource and get all the controllers under a same package exposed under the same version path. I was seeking for an elegant way of doing this without hardly coding the version part in all the controllers (like @RequestMapping("/v1/myresource")). I would like to know if applying the @RequestMapping at the package level (in an package-info.java) is an idea that is worth trying? If yes, I would gladly try to provide a pull request.


Affects: 4.3.10

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions