Improve enum support for json generator

Client: [json]
diff --git a/compiler/cpp/src/thrift/generate/t_json_generator.cc b/compiler/cpp/src/thrift/generate/t_json_generator.cc
index b94e81c..e91d65a 100644
--- a/compiler/cpp/src/thrift/generate/t_json_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_json_generator.cc
@@ -245,7 +245,7 @@
 
 void t_json_generator::write_type_spec_object(const char* name, t_type* ttype) {
   ttype = ttype->get_true_type();
-  if (ttype->is_struct() || ttype->is_xception() || ttype->is_container()) {
+  if (ttype->is_struct() || ttype->is_xception() || ttype->is_container() || ttype->is_enum()) {
     write_key_and(name);
     start_object(NO_INDENT);
     write_key_and("typeId");
@@ -275,7 +275,7 @@
     end_object();
   }
 
-  if (ttype->is_struct() || ttype->is_xception()) {
+  if (ttype->is_struct() || ttype->is_xception() || ttype->is_enum()) {
     write_key_and_string("class", get_qualified_name(ttype));
   } else if (ttype->is_map()) {
     t_type* ktype = ((t_map*)ttype)->get_key_type();
@@ -780,7 +780,7 @@
     return "map";
   }
   if (ttype->is_enum()) {
-    return "i32";
+    return "enum";
   }
   if (ttype->is_struct()) {
     return ((t_struct*)ttype)->is_union() ? "union" : "struct";
diff --git a/lib/json/schema.json b/lib/json/schema.json
index 90bb7a5..f7b10df 100644
--- a/lib/json/schema.json
+++ b/lib/json/schema.json
@@ -23,7 +23,8 @@
         "union",
         "struct",
         "binary",
-        "uuid"
+        "uuid",
+        "enum"
       ]
     },
     "base-type": {
@@ -67,7 +68,7 @@
       "type": "object",
       "properties": {
         "typeId": {
-          "enum": [ "union", "struct", "exception" ]
+          "enum": [ "union", "struct", "exception", "enum" ]
         }
       },
       "required": [ "typeId", "class" ]