Skip to content

@PathVariable, @RequestBody, @ApiParam, similar annotations, may be removed if they're present on superclass or interface #9

Open
@sambsnyd

Description

@sambsnyd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Recipes Wanted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions