title: Jackson - @JsonProperty and @JsonCreator serialize to json (List<Map<>>)
body: <p>I have properties <code>foo1</code>, <code>foo2</code>, <code>foo3</code>, <code>foo4</code>, <code>foo5</code>, <code>foo6</code> that are all Strings minus 2 of them as they are a list of strings and a mapping of strings. I am trying to construct them into a json in the following manner</p>
  <pre><code>{
  &quot;foo1&quot;: [
      {
          &quot;foo2&quot;: &quot;string&quot;,
          &quot;foo3&quot;: &quot;string&quot;,
          &quot;foo4&quot;: &quot;string&quot;,
          &quot;foo5&quot;: [
              &quot;string&quot;
          ]
      },
      &quot;foo6&quot;: &quot;string&quot;
  }
  </code></pre>
  <p>I know <code>foo5</code> is <code>List&lt;String&gt;</code> and that <code>foo1</code> is <code>List&lt;Map&lt;&gt;&gt;</code> but I am trying to gain some clarity around if it should be <code>Map&lt;String, Object&gt;</code> considering each of the <code>foo</code> values should be a <code>JsonProperty</code> as well as how to format the code itself.</p>
  <p>This is what I had so far</p>
  <pre><code>@JsonProperty
  public List&lt;Map&lt;String,Object&gt;&gt; foo1
  @JsonProperty
  public String foo2
  @JsonProperty
  public String foo3
  @JsonProperty
  public String foo4
  @JsonProperty
  public List&lt;String&gt; foo5
  @JsonProperty
  public String foo6
  
  @JsonCreator
  public static FooClass method(
          @JsonProperty(&quot;&quot;) final List&lt;Map&lt;String,Object&gt;&gt; foo1,
          @JsonProperty(&quot;&quot;) final String foo2,
          @JsonProperty(&quot;&quot;) final String foo3,
          @JsonProperty(&quot;&quot;) final String foo4,
          @JsonProperty(&quot;&quot;) final List&lt;String&gt; foo5,
          @JsonProperty(&quot;&quot;) final String foo6) {
  // How would I implement the logic here?
  }
  
  </code></pre>