anchor.diff:          }
           if (type != null) {
             String propName = escapeProperty(cleanName(key));
  +          String jsonName = key.replaceAll("\$", "\\\$");
             tmp.write("    if ($propName != null) {\n");
             if (array) {
  -            tmp.write("      output[\"$key\"] = new core.List();\n");
  +            tmp.write("      output[\"$jsonName\"] = new core.List();\n");
               tmp.write("      $propName.forEach((item) {\n");
               if (object) {
  -              tmp.write("        output[\"$key\"].add(item.toJson());\n");
  +              tmp.write("        output[\"$jsonName\"].add(item.toJson());\n");
               } else {
  -              tmp.write("        output[\"$key\"].add(item);\n");
  +              tmp.write("        output[\"$jsonName\"].add(item);\n");
               }
               tmp.write("      });\n");
             } else {
               if (object) {
  -              tmp.write("      output[\"$key\"] = $propName.toJson();\n");
  +              tmp.write("      output[\"$jsonName\"] = $propName.toJson();\n");
               } else {
  -              tmp.write("      output[\"$key\"] = $propName;\n");
  +              tmp.write("      output[\"$jsonName\"] = $propName;\n");
               }
             }
             tmp.write("    }\n");
  
positive.code:             tmp.write("      });\n");
            } else {
              if (object) {
                tmp.write("      $propName = new $type.fromJson(json[\"$key\"]);\n");
              } else {
                tmp.write("      $propName = json[\"$key\"];\n");
              }
            }
            tmp.write("    }\n");
  
negative.code:         }
          if (type != null) {
            String propName = escapeProperty(cleanName(key));
            String jsonName = key.replaceAll("\$", "\\\$");
            tmp.write("    if (json.containsKey(\"$jsonName\")) {\n");
            if (array) {
              tmp.write("      $propName = [];\n");
              tmp.write("      json[\"$jsonName\"].forEach((item) {\n");
              if (object) {
                tmp.write("        $propName.add(new $type.fromJson(item));\n");
              } else {
  