Hi,

Just want to ask on how I can add JSON object as part of the payload 
 request. Without adding this 

 public Response sampleMethod(
@Context HttpServletRequest request,
@Context HttpServletResponse response,
*@ApiParam(value = "Data for the body/payload", required = true) 
SampleObject dataSampleObject))*

{

..............................................

}


How can I tell swagger that sampleMethod API requires JSON object as part 
of POST request? without adding annotations as method parameter? 

Can I use *@ApiImplicitParams?*

Please see the code below. Is this applicable? but instead of file, it is 
JSON object. 

For file upload this is our implementation,

    @POST
    @Path("/uploadFile")
    @Consumes({MediaType.MULTIPART_FORM_DATA})
   * @ApiImplicitParams({*
*    @ApiImplicitParam(dataType = "file", name = "Log file", value="File 
containing logs", paramType = "form", required=true)*,
    @ApiResponses(value = {
   @ApiResponse(code = 200, message = "Success", 
response=SampleResponse.class),
   @ApiResponse(code = 400, message = "Bad request"),
   @ApiResponse(code = 404, message = "Service not found"),
   @ApiResponse(code = 500, message = "Internal server error") })
   public Response sampleMethod(@Context HttpServletRequest 
request,@Context HttpServletResponse response)
{

....................................

}


Thank you for answering this question! :)


-- 
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