Describe the bug When I define a feign client with two MediaTypes in produces (produces={MediaType.APPLICATION_PDF_VALUE, MediaType.APPLICATION_JSON_VALUE}), the client only sends the first value in the accept header.
I would expect the client to send both MediaTypes in the Accept header, separated by comma.
Current workaround The current workaround for me is to specify the produces attribute as String: produces=MediaType.APPLICATION_PDF_VALUE + "," + MediaType.APPLICATION_JSON_VALUE Then the accept header is send as expected.
Comment From: jnt0r
I created a repo with reproducible tests: https://github.com/jnt0r/feign-reproducable
As you can see in test and test2, only the first value of the produces map is send as content of the accept header. When defining produces as a string, the whole value is send.
Comment From: jnt0r
Looks like this method must be adjusted: https://github.com/spring-cloud/spring-cloud-openfeign/blob/8222ce4bbbda1170879437ac1dc6d80ac9ac5cd5/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/SpringMvcContract.java#L328-L334
Comment From: jnt0r
@OlgaMaciaszek any update on this?
Comment From: OlgaMaciaszek
Hello, @jnt0r, we will post any updates here. At this moment, we're prioritising some relaese-related items in our backlog.
Comment From: OlgaMaciaszek
Hello @jnt0r, thanks for reporting the issue. Since Spring Cloud OpenFeign is now in maintenance mode (we recommend switching to Spring Interface Clients), the team is not planning to implement any enhancements. However, if we receive a PR that addresses this feature, we will review it.
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.