We have observed an issue with Feign client.
When we use regular expression in path variables to duplicate the Feign client. The GET method request is converted to POST method request.
Please find the version of the APIs used, Spring cloud Greewich.SR3 Spring boot 2.1.1.RELEASE spring-cloud-starter-openfeign
Please find the sample request mappings,
@RequestMapping(value = { "/users/{userId:\d+}", "/v1/users/{userId:\d+}" }, method = { RequestMethod.GET })
@RequestMapping(value = { "/users/{candidateKey:VMW-\d{8}\w-\d{8}}", "/v1/users/{candidateKey:VMW-\d{8}\w-\d{8}}" }, method = { RequestMethod.GET })
@RequestMapping(value = { "/users/{email:.+@.+\..+}", "/v1/users/{email:.+@.+\..+}" }, method = { RequestMethod.GET })
Comment From: OLPMO
Could you provide a minimal demo to reproduce this bug?
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
Comment From: alonsohki
Also happening here. Here is my method signature (Kotlin):
@GetMapping(path = ["/v1/kyc-files/{proxyPath:.+}"])
fun getDocumentAttachment(
@PathVariable("proxyPath") proxyPath: String
) : ResponseEntity<Resource>
Comment From: vivek-nadar
Could you provide a minimal demo to reproduce this bug?
Apologies since mails from GIT HUB went to spam folder.
Can you let me know if you are expecting an working program for the issue ?
Alternatively, can you add the below request mappings in any spring controllers and check since replicating the issue might take minimal effort.
@RequestMapping(value = { "/users/{userId:\d+}", "/v1/users/{userId:\d+}" }, method = { RequestMethod.GET })
@RequestMapping(value = { "/users/{candidateKey:VMW-\d{8}\w-\d{8}}", "/v1/users/{candidateKey:VMW-\d{8}\w-\d{8}}" }, method = { RequestMethod.GET })
@RequestMapping(value = { "/users/{email:.+@.+..+}", "/v1/users/{email:.+@.+..+}" }, method = { RequestMethod.GET })
Thanks & Regards
Comment From: alonsohki
Additional info: Here are the Feign logs for the request (I hid private info):
---> GET https://xxxx.execute-api.eu-west-1.vpce.amazonaws.com/v1/kyc-files/uploads/xxxx/abcdefg.png HTTP/1.1
Authorization: AWS4-HMAC-SHA256 *****
Content-Length: 78
Content-Type: application/json;charset=UTF-8
Host: xxxx.execute-api.eu-west-1.vpce.amazonaws.com
X-Amz-Date: 20200331T141505Z
x-apigw-api-id: abcdefg
{"proxyPath":"uploads/xxxx/abcdefg.png"}
---> END HTTP (78-byte body)
Comment From: OlgaMaciaszek
@vivek-nadar @alonsohki. As requested by @OLPMO please provide a minimal, complete, verifiable example that reproduces the issue if you want us to look at this. First, please verify if the issue still exists on currently maintained SC OpenFeign versions (3.1.6 or 4.0.1).
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: alonsohki
@vivek-nadar @alonsohki. As requested by @OLPMO please provide a minimal, complete, verifiable example that reproduces the issue if you want us to look at this. First, please verify if the issue still exists on currently maintained SC OpenFeign versions (
3.1.6or4.0.1).
I am sorry but I reported this three years ago. I haven't used spring in two years. I cannot even remember what this was about.
Comment From: tonyfarney
The bug is still happening here. I am using the following version: https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-openfeign-dependencies/2.2.2.RELEASE
Comment From: OlgaMaciaszek
@tonyfarney This version has not been supported for a very long time now. 3.1.8 and 4.0.4 are currently supported.
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-cloud-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.