title: How to represent fields with generic types like List<Something> in swagger-spring-mvc for swagger-codegen
body: <p>I'm using swagger-spring-mvc 0.9.5 and have fields like this in my response data:</p>
  
  <pre><code>@ApiModelProperty("Some description")
  private List&lt;Account&gt; accounts;
  </code></pre>
  
  <p>Short version of the question: <strong>how can I get from this annotated Java to e.g. Objective C via swagger-codegen?</strong></p>
  
  <p>The swagger JSON that gets generated by that is:</p>
  
  <pre><code>accounts: {
    description: "Some description",
    items: {
      type: "Account"
    },
    required: false,
    type: "List"
  }
  </code></pre>
  
  <p>My colleague is feeding this into swagger-codegen to generate Objective C classes, and it's producing code that doesn't compile.</p>
  
  <pre><code>@property (nonatomic, strong) NSArray&lt;Optional, NSArray&gt; *accounts;
  </code></pre>
  
  <p>because <code>NSArray</code> (inside the <code>&lt; &gt;</code>) isn't a protocol.</p>
  
  <p>The swagger template files (mustache) create a protocol for each model. When that protocol is specified on an array, it is picked up by JSONModel to generate the correct models from the data inside the list / array. So in this case the expected output is</p>
  
  <pre><code>@property (nonatomic, strong) NSArray&lt;Optional, MAAccount&gt; *accounts;
  </code></pre>
  
  <p>This will create an <code>NSArray</code> of <code>MAAccount</code>'s (<code>Account</code> being the object type and <code>MA</code> being a prefix that swagger already has).</p>
  
  <p>If we hand-edit the swagger JSON to change <code>List</code> to <code>array</code> (as suggested in various similar cases), the output is correct, but we want to avoid this manual step.</p>
  
  <p>So I tried to get swagger-spring-mvc to use <code>"array"</code>:</p>
  
  <pre><code>@ApiModelProperty(value = "Some description", dataType = "array")
  private List&lt;Account&gt; accounts;
  </code></pre>
  
  <p>But then discovered that <code>dataType</code> is ignored in swagger-spring-mvc 0.9.5, and by the looks of it, in springfox 2.0 it is ignored unless it's a fully-qualified Java class name.</p>
  
  <p>Is there a way to achieve this, either by getting swagger-spring-mvc/springfox to use <code>"array"</code> or by any other means?</p>