spring-cloud / spring-cloud/spring-cloud-openfeign
Trailing slash was added while posting to service context path
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.3k
- Forks
- 838
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 13
Description
There are two services, service A and service B.
in Service B, its context path is member and there is a controller defined as follow
@Contoller
public MemberController {
@PostMapping
public Member saveMember(Member member){
}
}
and in Service A, a Feign client is defined to call this endpoint
@FeignClient(name = "service-b", path = "member")
public MemberFeignClient {
@PostMapping
public Member saveMember(Member member);
}
While executing the code, feign client print log with location calling to http://service-b/member/, which a trailing slash was added. I tried to add config from code or autoconfig to remove it but it was still added.
As Spring is no longer support trailing slash, it threw error as the path not found.
Version:
Spring Cloud OpenFeign: 5.0.1
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
Reproduce the request using the Service A Feign client and Service B controller shown in the issue, then trace how @FeignClient(path = "member") and @PostMapping combine into the request URL. Done when the generated POST target omits the trailing slash and a regression test covers this context-path case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100