-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
feedback providedFeedback has been provided to the authorFeedback has been provided to the author
Description
Version : 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.
Metadata
Metadata
Assignees
Labels
feedback providedFeedback has been provided to the authorFeedback has been provided to the author