title: Jackson Serialization of an Arraylist of objects with variable key
body: <p>I'm using a few different POJO's to generate a swagger API spec. However, I'm having an issue when trying to format the JSON properly. </p>
  
  <p>Currently the response looks like this: </p>
  
  <h1>Resulting JSON</h1>
  
  <pre><code> {
     "parameters": {
        "regionid": {
           "description": "Region ID for Regional Assignment",
           "required": false,
           "type": "integer",
           "format": "int32"
         },
        "timeperiodid": {
           "description": "School year time period",
           "required": false,
           "type": "integer",
           "format": "int32"
         }
      }
  }
  </code></pre>
  
  <h1>Resulting Yaml</h1>
  
  <pre><code>parameters:
      regionid:
        description: Region ID for Regional Assignment
        required: false
        type: integer
        format: int32
      timeperiodid:
        description: School year time period
        required: false
        type: integer
        format: int32
  </code></pre>
  
  <p>Instead of the correct format (ArrayList of objects): </p>
  
  <h1>Expected JSON</h1>
  
  <pre><code> {
     "parameters": [
      {
        "regionid": {
           "description": "Region ID for Regional Assignment",
           "required": false,
           "type": "integer",
           "format": "int32"
         }
      },
      {
        "timeperiodid": {
          "description": "School year time period",
          "required": false,
          "type": "integer",
          "format": "int32"
           }
         }
       ]
     }
  </code></pre>
  
  <h1>Expected Yaml</h1>
  
  <pre><code>parameters:
      - regionid:
          description: Region ID for Regional Assignment
          required: false
          type: integer
          format: int32
      - timeperiodid:
          description: School year time period
          required: false
          type: integer
          format: int32
  </code></pre>
  
  <p>Method Class Which wraps and returns the parameters:</p>
  
  <pre><code> public class Method {
     @JsonIgnore
     private String method;
  
     private HashMap&lt;String, Parameter&gt; parameters;
  </code></pre>
  
  <p>Parameter Object Class:</p>
  
  <pre><code> @JsonInclude(JsonInclude.Include.NON_NULL)
   public class Parameter {
     @JsonIgnore
     private String name;
  
     private String in;
  
     private String description;
  
     private boolean required;
  
     private String type;
  
     private String format;
  </code></pre>