Support feign.Request as interface method parameter
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.8k
- Forks
- 1.9k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 41
Description
Hello everyone,
In one of our project, we would like to use feign as a proxy client. As such, we need multiple dynamic resolutions:
- http method
- headers
- url
- query
- etc.
I searched a bit but did not find a satisfying solution using feign. What I would love is to have the possibility to use a feign.Request as parameter:
public interface MyClient {
feign.Response request(feign.Request request);
}
This kind of method quickly fails with Method MyClient#request(Request) not annotated with HTTP method type (ex. GET, POST).
Another thing I tried is to dynamically resolve the http method:
public interface MyClient {
@RequestLine("{method}")
feign.Response request(@Param("method") HttpMethod method, ...);
}
but this also quickly fails with RequestLine annotation didn't start with an HTTP verb on method.
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
Start by locating the Feign method validation that emits “not annotated with HTTP method type” and the RequestLine parsing that rejects a dynamic verb. Read how interface methods become requests, then determine the expected behavior for a method accepting feign.Request. Done means the interface example can execute dynamic HTTP methods, headers, URLs, and queries without those validation errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100