Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve SpringMvcEndpointDetector by detecting new RequestMapping annotation shortcuts #244

Merged
merged 1 commit into from Dec 20, 2016
Merged

Improve SpringMvcEndpointDetector by detecting new RequestMapping annotation shortcuts #244

merged 1 commit into from Dec 20, 2016

Conversation

ptamarit
Copy link
Contributor

Spring 4.3 introduced new annotation shortcuts for @RequestMapping.
For instance, @GetMapping is a composed annotation that acts as a shortcut for @RequestMapping(method = RequestMethod.GET).

The full list of new shortcut annotations is:

  • @GetMapping
  • @PostMapping
  • @PutMapping
  • @DeleteMapping
  • @PatchMapping

This pull request improves SpringMvcEndpointDetector by detecting these new annotations.

Some remarks regarding this pull request:

  • I modified the English message, but I don't have the necessary skills to modify the corresponding Japanese one.
  • Instead of having a hardcoded list of annotations, a more future-proof solutions would be to rely on the annotations hierarchy. Indeed, @GetMapping is annotated with @RequestMapping, @RequestMapping is annotated with @Mapping, and @Mapping is described as a "Meta annotation that indicates a web mapping annotation". However, I didn't find a way of going up one annotation's hierarchy with FindBugs.

@h3xstream h3xstream merged commit 59cb1c1 into find-sec-bugs:master Dec 20, 2016
@ptamarit ptamarit deleted the spring-endpoint-request-mapping-shortcuts branch December 20, 2016 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants