title: Swagger UI incorrectly render java.util.Map
body: <p>I am trying to integrate my Spring MVC application with Swagger to get REST API documentation clean and up to date. But I run into a problem of representing java Map in swagger UI. Here are my simple controller and model:</p>
  
  <ul>
  <li>User</li>
  </ul>
  
  <pre class="lang-java prettyprint-override"><code>@Data
  @ApiModel
  public class User {
  
    @ApiModelProperty(example = "test@example.com")
    private String email;
  
    @ApiModelProperty(example = "John")
    private String firstName;
  
    @ApiModelProperty(example = "Doe")
    private String lastName;
  
    @ApiModelProperty
    private Map&lt;String, Address&gt; addresses;
  
  }
  </code></pre>
  
  <ul>
  <li>Address</li>
  </ul>
  
  <pre class="lang-java prettyprint-override"><code>@Data
  @ApiModel
  public class Address {
  
    @ApiModelProperty(example = "Calle 39 No 1540")
    private String street;
  
    @ApiModelProperty(example = "B1000TBU")
    private String postalCode;
  
    @ApiModelProperty(example = "San Sebastian")
    private String city;
  
    @ApiModelProperty(example = "Argentina")
    private String country;
  
  }
  </code></pre>
  
  <ul>
  <li>User Controller</li>
  </ul>
  
  <pre class="lang-java prettyprint-override"><code>@RestController
  @Api(value = "User Management")
  public class UserController {
  
    @ApiOperation("Get a user profile by the email")
    @RequestMapping(value = "/user/{email:.+}", method = RequestMethod.GET)
    public User getPersonByFirstName(@ApiParam @PathVariable("email") String email) {
      return new User();
    }
  }
  </code></pre>
  
  <p>For generating Swagger specification I use Swagger Maven Plugin. In the and I got next documentation:</p>
  
  <p><a href="https://i.stack.imgur.com/V0ZUc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/V0ZUc.png" alt="enter image description here"></a> </p>
  
  <p>Instead of proper type ‒ <strong>Map[String, Address]</strong> ‒ I got weird inline_model. On tab <em>Example value</em> the value of addresses is just empty object ‒ <strong>{}</strong>.</p>
  
  <p>I try to specify data type of this Map field, but no of the following annotations will work:</p>
  
  <ul>
  <li><p>@ApiModelProperty(value = "addresses", dataType =
  "Map[string,com.redkite.model.Address]")</p></li>
  <li><p>@ApiModelProperty(value = "addresses", dataType = "java.util.Map")</p></li>
  <li><p>@ApiModelProperty(value = "addresses", dataType =
  "java.util.Map&lt; java.lang.String, com.redkite.model.Address>")</p></li>
  </ul>
  
  <p>Also, I try to find the answer in <a href="https://stackoverflow.com/questions/35411621/how-to-tell-swagger-an-attribute-is-a-map">related question</a> but it does not solve my problem.</p>
  
  <p>The question is ‒ Does Swagger UI support java Map at all? If not ‒ Is there some work around for fixing this issue?</p>
  
  <p>I use next versions of frameworks and plugins:</p>
  
  <ul>
  <li>Swagger Maven Plugin ‒ 3.1.3 (generates specification of version 2.0)</li>
  <li>Swagger-annotations ‒ 1.5.9</li>
  <li>Swagger UI ‒ 2.2.10</li>
  </ul>
  
  <p>For more information attaching <a href="http://ttps://drive.google.com/open?id=0ByU3kEX0cKUwa3RoTENpejhmSHc" rel="noreferrer">generated specification</a>.</p>