title: How to pass Array of Objects as parameter in Java swagger UI?
body: <p>I need to <strong>pass an array of objects as parameter in java Swagger UI</strong>. I am unable to do it. However I can easily pass array of string as parameters. But <strong>cant figure out how to pass array of objects nested inside another class or DTO.</strong> I am using Java Spring and developing RESTful webservice.</p>
  
  <p>Below is my 1st DTO that is passed as ModelAttribute in my REST api as parameter:</p>
  
  <pre><code>public class BusinessDetailsDTO {
  
      private BusinessMembersDTO[] businessMembers;
  
      public BusinessMembersDTO[] getBusinessMembers() {
          return businessMembers;
      }
      public void setBusinessMembers(BusinessMembersDTO[] businessMembers) {
          this.businessMembers = businessMembers;
      }
  }
  </code></pre>
  
  <p>Below is 2nd DTO whose array is made property in 1st DTO:</p>
  
  <pre><code>public class BusinessMembersDTO {
  
      private String ownerRole;
      private String businessLocation;
      private Long memberId;
      //getter setter below 
  }
  </code></pre>
  
  <p>Below is the controller method definition: </p>
  
  <pre><code>@ApiOperation(value = "Add business info")
      @RequestMapping(method = RequestMethod.POST, value = "/addBusinessInfo", produces={"application/json"})
      @ApiResponses(value = {
              @ApiResponse(code = 200, message = "Success", response = ResponseEntity.class),
              @ApiResponse(code = 401, message = "Unauthorized"),
              @ApiResponse(code = 403, message = "Forbidden"),
              @ApiResponse(code = 404, message = "Not Found"),
              @ApiResponse(code = 500, message = "Failure") })
      public ResponseEntity&lt;BusinessDetails&gt; addBusinessInfo(@RequestParam(
              @ModelAttribute BusinessDetailsDTO businessDetailsDTO) {
  </code></pre>
  
  <p>My problem is, I am unable to figure out <strong>how should I pass values <code>ownerRole</code> which is present in <code>BusinessMembersDTO</code></strong>. 
  <strong>The swagger UI shows <code>Array[]</code> in DataType column next to <code>businessMembers</code> members field.</strong></p>
  
  <p>Plz help.</p>