title: Generate Enum in Java Client with Swagger
body: <p>I am trying to create an API using Swagger 2.0. I would like to generate an interactive documentation using SwaggerUI and also generate API clients (in Java, JavaScript...). I just tried to generate a small Java Client.</p>
  
  <p>I have a problem with Enumerations... In Swagger I can write the following (YAML here, the problem is the same if directly writing JSON):</p>
  
  <pre><code> definitions:
     MediumStatus:
       type: string
       enum:
         - CLOSED
         - OPEN_AVAILABLE
         - OPEN_NOT_AVAILABLE
         - NOT_AVAILABLE
  </code></pre>
  
  <p>In the generated Java Client, what is expect/want is something like:</p>
  
  <pre><code>public enum MediumType
  {
  CLOSED,
  OPEN_AVAILABLE,
  OPEN_NOT_AVAILABLE,
  NOT_AVAILABLE;
  
  public String value()
  {
      return name();
  }
  
  public static MediumType fromValue(String v)
  {
      return valueOf(v);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>but the SwaggerCodegen generate a client with:</p>
  
  <pre><code>    @ApiModel(description = "")
      @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2015-12-21T14:03:23.470Z")
     public class MediumType   {
  
    @Override
    public String toString()  {
      StringBuilder sb = new StringBuilder();
      sb.append("class MediumType {\n");
  
      sb.append("}");
      return sb.toString();
    }
  }
  </code></pre>
  
  <p>This class is not really correct, it don't even contains the enum values !</p>
  
  <p>Can someone can tell me what I am missing ?</p>
  
  <p>EDIT/</p>
  
  <p>Problem sovlded with <a href="https://github.com/swagger-api/swagger-codegen/pull/1740" rel="nofollow">https://github.com/swagger-api/swagger-codegen/pull/1740</a></p>