title: How to control the way Swagger generates the model/schema for a type
body: <p>I was able to setup <strong>Swagger</strong> with <strong>Play</strong> and try Swagger-ui... and I must say it's really great.</p>
  
  <p>Documenting the actions of my controller with <code>ApiOperation</code>, <code>ApiImplicitPara</code>, etc. was easy and it works as expected.</p>
  
  <p>Nevertheless, due to my limited knowledge of Swagger, I've an issue when defining the schema for an implicit parameter of type <code>body</code>. The class I want to map to the implicit parameter looks like this:</p>
  
  <pre><code>@ApiModel(value "User", description = "Represents an user")
  class User private(private var json: JsValue) {
  
    private def setValue(key: JsPath, value: JsValue) = {
      value match {
        case JsNull =&gt; json.transform(key.json.prune).map(t =&gt; json = t)
        case _ =&gt; json.transform((__.json.update(key.json.put(value)))).map(t =&gt; json = t)
      }
    }
  
    def asJson = json
  
    @ApiModelProperty(value = "User's id", dataType = "String", required = false)
    def id_= (v: Option[String]) = setValue((__ \ 'id), Json.toJson(v))
    def id = json as (__ \ 'id).readNullable[String]
    @ApiModelProperty(value = "User's email address", dataType = "String", required = true)
    def email = json as (__ \ 'email).read[String]
    def email_= (v: String) = setValue((__ \ 'email), Json.toJson(v))
    @ApiModelProperty(value = "User's firstName", dataType = "String", required = true)
    def firstName = json as (__ \ 'firstName).read[String]
    def firatName_= (v: String) = setValue((__ \ 'firstName), Json.toJson(v))
    ...
  }
  
  object User {
  
    def apply(
      id: Option[String],
      email: String,
      firstName: String,
    ): JsResult[User] = apply(Json.obj(
      "id" -&gt; id,
      "email" -&gt; email,
      "firstName" -&gt; firstName,
      ...
    ))
  }
  </code></pre>
  
  <p>The internal representation of my model classes is JSON... and then I just provide getters and setters that read/modify the internal JSON &ndash; this solution let me handle JSON very quickly and I can pass the object as-is to MongoDB.</p>
  
  <p>The problem is that the model generated by Swagger for the class above is like this:</p>
  
  <pre><code>User {
    json(JsValue),
    id(String): User's id,
    email(String): User's email,
    firstName(String): User's first name,
    ...
  }
  </code></pre>
  
  <p>How do I prevent Swagger from putting <code>json</code> in the model?</p>