JAXRS contract on API with @HeaderParam("Content-Type") and @Consumes with multiple values cause feign client build fail
See original GitHub issueVersion : 11.0
API :
@POST
@Path("/{stream:.+}")
@Consumes({"application/xlsx", "text/csv"})
@Produces("application/json")
List<Integer> sourceFile(
@PathParam("stream") String stream,
@QueryParam("delimiterChar") @DefaultValue(",") String delimiterChar,
@HeaderParam("Content-Type") String contentType,
@RequestBody(required = true, description = "Input file") InputStream file
) throws IOException;
Calling API with :
myCtrl.sourceFile("stream", null, "text/csv", inputStream);
Causes the error :
java.lang.NullPointerException: null
at feign.okhttp.OkHttpClient.toOkHttpRequest(OkHttpClient.java:64) ~[feign-okhttp-11.0.jar:na]
at feign.okhttp.OkHttpClient.execute(OkHttpClient.java:168) ~[feign-okhttp-11.0.jar:na]
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:119) ~[feign-core-11.0.jar:na]
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:89) ~[feign-core-11.0.jar:na]
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100) ~[feign-core-11.0.jar:na]
at com.sun.proxy.$Proxy143.sourceFile(Unknown Source) ~[na:na]
Because at OkHttpClient:62 (mediaType = MediaType.parse(value);), value variable equals "application/xlsx, text/csv" instead of "text/csv".
Method MediaType.parse(value) returns null as "application/xlsx, text/csv" is not a valid media type.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Openfeign How to use @Headers annotation with different ...
I want to be able to do same thing but there is no Produces or consumes headers in feign client. There is only...
Read more >Consuming REST API Using Feign - Nimbleways
Introduction · 1. first, create the request for the remote resource by specifying the URL, and the ( headers, body ) if needed....
Read more >RESTEasy JAX-RS - JBoss.org
Used when the client is unable to use an Accept header to choose a representation (i.e. a browser). See Chapter 19, JAX-RS Content...
Read more >Setting Request Headers Using Feign - Baeldung
Using the @Header annotation, we can easily configure a static request header. We can define this header value either statically or dynamically.
Read more >AppDynamics_Cloud_Cogeng_...
1.40 javabeans-activation-framework-api 1.2.2 ... 1.58 jackson-jaxrs 2.13.2 ... Agreement or the failure by Confluent to exercise any right hereunder.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Learn something every day…
Au contraire my good friend. Both support many values
The way encoders/decoders work on jax-rs allow they to handle multiple just fine.