Skip to content

Feature "warn when GET method has unannotated parameters" causes incorrect warning for methods with a single URI parameter. #1326

@asharayev

Description

@asharayev

Describe the bug
A feign client interface with GET methods having a single java.net.URI argument cause incorrect warning on startup:

org.springframework.cloud.openfeign.support.SpringMvcContract
WARN
[OpenFeign Warning] Feign method 'public abstract java.lang.String net.sample.SampleClient.getValue(java.net.URI)' is declared as GET with parameters, but none of the parameters are annotated (e.g. @RequestParam, @RequestHeader, @PathVariable, etc). This may result in fallback to POST at runtime. Consider explicitly annotating parameters.

The warning comes from feature "feat: warn when GET method has unannotated parameters" #1194
I believe it should not print warning in this case.

Sample

import java.net.URI;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

@FeignClient(name = "sample", url = "http://localhost")
public interface SampleClient {

    @GetMapping(value = "/sample/receive")
    String getValue(URI baseUri);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions