The spec doesn’t support uploading arbitrary number of files, but you can upload several files if you define each one of the explicitly.
From: <swagger-swaggersocket@googlegroups.com> on behalf of tony tam <feh...@gmail.com> Reply-To: "swagger-swaggersocket@googlegroups.com" <swagger-swaggersocket@googlegroups.com> Date: Wednesday, 25 January 2017 at 14:08 To: "swagger-swaggersocket@googlegroups.com" <swagger-swaggersocket@googlegroups.com> Subject: Re: Can we have more than one InputStream in the Swagger UI ? Hi Sundar, I think there are two issues. First off, only one File is supported per operation in the 2.0 specification. I understand that’s an annoying limitation but it is the spec, and you cannot expect tooling to support multiple files in one operation. Next, that error message is very, very hard to track down. Take a look at this example for how to do it properly: https://github.com/swagger-api/swagger-samples/blob/master/java/java-jersey-jaxrs/src/main/java/io/swagger/sample/resource/PetResource.java#L95 On Jan 25, 2017, at 2:04 PM, Sundar Saranathan <sundar.saranat...@gmail.com> wrote: Hi, I have an API that needs two input files. I was thinking of using @ApiParam(value = "data1", required=true,allowMultiple =true) InputStream inputStream1 @ApiParam(value = "data2", required=true,allowMultiple =true) InputStream inputStream2 Inside the code, I read the contents of inputstream and convert that to a file . However, I am getting errors when the app is initialized and also, the contents of the first InputStream is not passed to the API. Only the contents in the second InputStream goes through.. [ERROR ] The following errors and warnings have been detected with resource and/or provider classes: SEVERE: Missing dependency for method public javax.ws.rs.core.Response com.xxx.test(java.io.InputStream,java.io.InputStream) throws org.json.JSONException at parameter at index 0 SEVERE: Missing dependency for method public javax.ws.rs.core.Response com.xxx.test(java.io.InputStream,java.io.InputStream) throws org.json.JSONException at parameter at index 1 SEVERE: Method, public javax.ws.rs.core.Response com.xxx.test(java.io.InputStream,java.io.InputStream) throws org.json.JSONException, annotated with POST of resource, class com.xxx.test, is not recognized as valid resource method. [ERROR ] SRVE0271E: Uncaught init() exception created by servlet [Jersey Web Application] in application [RestTEst]: com.sun.jersey.spi.inject.Errors$ErrorMessagesException at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170) Is this supported ? Thanks in Advance, Sundar. -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.