Skip to content

Multiple quick fixes offered for @RequestMapping into GetMapping etc #1107

Closed

Description

@BoykoAlex

Currently OR only allows for converting @RequestMapping into precise mapping if only one Request Method is inferred from the @RequestMapping. However, if there are multiple request methods such @RequestMapping without the method parameter then it'd be useful to show a reconcile problem and offer quick fix for each method type.

Might be of some use flag all @RequestMapping annotations over methods and offer multiple quick fixes for @RequestMapping that has explicitly specified multiple request methods.

Activity

  1. added this to the 4.20.1.RELEASE milestone on Sep 6, 2023
  2. self-assigned this
    on Sep 6, 2023
  3. added
    for: eclipse
    for: vscode
    and removed on Sep 11, 2023
  4. BoykoAlex commented on Sep 14, 2023

    @BoykoAlex
    ContributorAuthor

    @martinlippert Precise annotations are GET, POST, PUT, DELETE, PATCH. This excludes OPTIONS and TRACE. Therefore if method type has OPTIONS or TRACE - no problem. Now, if there is a few request methods specified, i.e. POST and PUT. Shall I offer switching to either @PostMapping or @PutMapping?
    Maybe all we want is just support @RequestMapping("/hello") kind of annotation where request method is unspecified?

  5. BoykoAlex commented on Sep 15, 2023

    @BoykoAlex
    ContributorAuthor

    I have pushed 78cd6ac. Just show a number of quick fixes for @RequestMapping not specifying any request methods... likely this needs to be a specific request mapping not any request method. Therefore if two or more request methods specified the annotation won't be flagged and refactoring not offerred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: eclipsefor: vscodetheme: refactoringtype: enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions