@RequestHeader overrides @PathVariable with the same name
メンテナーはふだん 1 日以内に返信
@rajeshvasa がすでに取り組んでいます。
2026年11月18日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 64/100
調査の方向性
Start by tracing how Spring Cloud OpenFeign resolves @PathVariable and @RequestHeader parameters when they share a name, then find the related request mapping tests. Reproduce the sample request and verify that the URI uses 1 for {id} while the header remains A. Add a regression test for the behavior and run the relevant tests.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
If @RequestHeader and @PathVariable have the same name, the header value is inserted to the uri template instead of the path variable.
Spring HTTP Service Clients does not have this problem.
Sample
interface TestApi {
@GetMapping(value = "/test/{id}")
void test(@PathVariable Integer id, @RequestHeader("id") String headerId);
}
@FeignClient(name = "testClient", url = "http://localhost:8080")
interface TestClient extends TestApi {
}
@RestController
class TestController implements TestApi {
public void test(Integer id, String headerId) {
}
}
@SpringBootApplication
@EnableFeignClients
class SampleApplication implements ApplicationRunner {
@Autowired
private TestClient testClient;
public void run(ApplicationArguments args) {
// this requests test/A instead of test/1
testClient.test(1, "A");
}
public static void main(String[] args) {
SpringApplication.run(SampleApplication.class, args);
}
}
Dependencies:
implementation(platform("org.springframework.boot:spring-boot-dependencies:4.1.2"))
implementation(platform("org.springframework.cloud:spring-cloud-dependencies:2025.1.4"))
implementation(platform("io.github.openfeign:feign-bom:13.18"))
implementation("org.springframework.boot:spring-boot-starter-webmvc")
implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
If using Spring HTTP Service Clients, the problem is not reproduced:
interface TestClient {
@GetExchange("/test/{id}")
void test(@PathVariable Integer id, @RequestHeader("id") String headerId);
}
- 主要言語
- Java
- スター
- 1.3k
- フォーク
- 834
- 平均マージ
- 3日 6時間
- マージ済み PR(30日)
- 14
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
spring-cloud/spring-cloud-openfeign のほかの issue
-
question
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
spring-cloud/spring-cloud-openfeign#1392 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
FeignClientsConfiguration$MicrometerConfiguration.class cannot be opened because it does not existオープンfeedback-provided
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
spring-cloud/spring-cloud-openfeign#1379 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
waiting-for-triage
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
spring-cloud/spring-cloud-openfeign#1340 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
dependencies
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
spring-cloud/spring-cloud-openfeign#1334 · コメント 11 件 · リアクション 4 件 ·
メンテナーはふだん 1 日以内に返信
-
waiting-for-triage
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
spring-cloud/spring-cloud-openfeign#1309 · コメント 7 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
spring-cloud/spring-cloud-openfeign の issue をすべて見る
似ている issue
-
area:cpan-port area:performance bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fglock/PerlOnJava#2230 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
federicoiosue/Omni-Notes#1044 ·
-
Bug
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信