title: Serializing enums with Jackson
body: <p>I have an Enum desrcibed below:</p>
  
  <pre><code>public enum OrderType {
  
    UNKNOWN(0, "Undefined"),
    TYPEA(1, "Type A"),
    TYPEB(2, "Type B"),
    TYPEC(3, "Type C");
  
    private Integer id;
    private String name;
  
    private WorkOrderType(Integer id, String name) {
      this.id = id;
      this.name = name;
    }
  
    //Setters, getters....
  }
  </code></pre>
  
  <p>I return enum array with my controller ( <code>new OrderType[] {UNKNOWN,TYPEA,TYPEB,TYPEC};</code>), and Spring serializes it into the following json string:</p>
  
  <pre><code>["UNKNOWN", "TYPEA", "TYPEB", "TYPEC"] 
  </code></pre>
  
  <p>What is the best approach to force Jackson to serialize enums just like POJOs? E.g.:</p>
  
  <pre><code>[
    {"id": 1, "name": "Undefined"},
    {"id": 2, "name": "Type A"},
    {"id": 3, "name": "Type B"},
    {"id": 4, "name": "Type C"}
  ]
  </code></pre>
  
  <p>I played with different annotations but couldn't manage to get such result.</p>