thank you Ron, I'll follow that approach.

H

On Wed, Nov 23, 2016 at 9:45 PM, Ron Ratovsky <[email protected]> wrote:

> You’d probably have to file a ticket on the maven plugin then, as it does
> the annotation introspection and probably ignores the ‘hidden’ property.
>
>
>
>
>
>
>
> *From: *<[email protected]> on behalf of Horaci
> Macias <[email protected]>
> *Reply-To: *"[email protected]" <
> [email protected]>
> *Date: *Wednesday, 23 November 2016 at 12:41
> *To: *"[email protected]" <swagger-swaggersocket@
> googlegroups.com>
> *Subject: *Re: swagger-ui and multipart form file uploads
>
>
>
> Hi Ron,
>
>
>
> I'm using swagger-jaxrs 1.5.10, swagger-ui 2.2.6 (from org.webjars which I
> then embed on my war file) and I'm generating the swagger.json file from
> maven, using swagger-maven-plugin (com.github.kongchen) 3.1.0.
>
>
>
> thanks,
>
>
>
> H
>
>
>
> On Wed, Nov 23, 2016 at 7:45 PM, Ron Ratovsky <[email protected]> wrote:
>
> Which version of swagger-core are you using?
>
>
>
>
>
>
>
> *From: *<[email protected]> on behalf of Horaci
> Macias <[email protected]>
> *Reply-To: *"[email protected]" <
> [email protected]>
> *Date: *Wednesday, 23 November 2016 at 4:30
> *To: *Swagger <[email protected]>
> *Subject: *swagger-ui and multipart form file uploads
>
>
>
> Hi everybody,
>
>
>
> I'm trying to use swagger-ui and annotations to document my REST java
> backed.
>
> For some reason the generated swagger.json has a duplicate parameter for
> the file.
>
>
>
> If I use the following java code/annotations:
>
>
>
> @POST
> @Path(*"/fileupload"*)
> @Consumes(MediaType.*MULTIPART_FORM_DATA*)
> @ApiOperation(
>       value = *"Imports CSV file"*,
>       notes =
> *"Bulk imports all users from CSV file into database."*)
> @ApiResponses({
>       @ApiResponse(code = 200, message = *"Import successful"*),
>       @ApiResponse(code = 500, message= *"Error importing file"*)
> })
> @ApiImplicitParams(@ApiImplicitParam(dataType = *"file"*, name = *"upload"*, 
> paramType = *"formData"*, required = *true*))
> *public *Response uploadFile(@ApiParam(hidden = *true*, name = *"upload"*) 
> @FormParam(*"upload"*) File upload) {
>
>
>
> this is the json generated:
>
>
>
>     "/users/fileupload" : {
>
>       "post" : {
>
>         "tags" : [ "Users" ],
>
>         "summary" : "Imports CSV file",
>
>         "description" : "Bulk imports all users from CSV file into
> database.",
>
>         "operationId" : "uploadFile",
>
>         "consumes" : [ "multipart/form-data" ],
>
>         "produces" : [ "application/json" ],
>
>         "parameters" : [ {
>
>           "name" : "upload",
>
>           "in" : "formData",
>
>           "required" : false,
>
>           "type" : "string"
>
>         }, {
>
>           "name" : "upload",
>
>           "in" : "formData",
>
>           "required" : true,
>
>           "type" : "file"
>
>         } ],
>
>         "responses" : {
>
>           "200" : {
>
>             "description" : "Import successful"
>
>           },
>
>           "500" : {
>
>             "description" : "Error importing file"
>
>           }
>
>         }
>
>       }
>
>     },
>
>
>
> which swagger-ui shows as a duplicate parameter, one being required (the
> file upload which is the only one I want to see) and another non-required
> of data type "String":
>
>
> <https://lh3.googleusercontent.com/-PJQqIQdD-kU/WDWLprVud1I/AAAAAAAAHKM/qUT-CSUDzrotkMVcLOGoBeoUbj4SEtFsgCLcB/s1600/swaggeruifile.png>
>
> Does anybody have a working example of this same scenario? how can I make
> sure swagger-ui just shows a single "upload" parameter of type "file" ?
>
>
>
> thanks,
>
>
>
> H
>
>
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Swagger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/swagger-swaggersocket/_ZvVuNweJwE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Swagger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/swagger-swaggersocket/_ZvVuNweJwE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to