Support one-time configuration of expression parameters
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.8k
- Forks
- 1.9k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 41
Description
Problem
Let's say I have a request template that looks like this:
@RequestLine("GET /{env}/{resource}")
void getResource(@Param("env") String env, @Param("resource") String resource);
In the application that defines this template, env is configured at startup and will only ever have 1 value (e.g. "production" or "qa") during the application's lifespan. It would make sense to not have to pass this same value into each call of getResource().
Default methods are of no help here because env still needs to be dynamically set.
Proposal
Support on-time configuration of expression parameters via configuration methods on the client interface:
@Configuration
void setEnv(@Param("env") String env);
@RequestLine("GET /{env}/{resource}")
void getResource(@Param("resource") String resource);
Implementing this is pretty easy (~150 lines).
N.B. this proposal is somewhat similar to https://github.com/OpenFeign/feign/issues/1359.
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
No files, tests, or entry points are named. Start by tracing how Feign processes @RequestLine, @Param, and interface configuration methods, then determine where a configured parameter can be retained and applied to later calls; done means one-time configuration removes that value from each request method's arguments.
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