openrewrite / openrewrite/rewrite-spring
@PathVariable, @RequestBody, @ApiParam, similar annotations, may be removed if they're present on superclass or interface
Nobody has claimed this yet.
- #698 by @arodionov — closed without merging
- Dominant language
- Java
- Stars
- 403
- Forks
- 149
- Avg merge
- 2h 33m
- Merged PRs (30d)
- 10
Description
There are various spring annotations, including but not limited to @PathVariable, @RequestBody, @Valid, @Size, @ApiParam, @Pattern, which allow developers to tell spring about the contract their API has.
If these annotations are present on a superclass or interface being implemented then they can be removed from the subclass.
Leaving them isn't necessarily harmful so long as the arguments of the duplicated annotations match. If the arguments do not match it's a spring runtime error. So this is a "best practices & hygiene" rather than an "essential for migration" sort visitor.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the annotation cases listed in the issue and the history of closed pull request #698 before starting. Identify the existing recipe entry point and tests for Spring annotation handling, then verify that inherited annotations are removed only when appropriate and that coverage includes the listed annotation types and conflicting arguments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100