anchor.diff:          if (type != null) {
             String propName = escapeProperty(cleanName(key));
             if (property.containsKey("description")) {
  -            tmp.write("\n  /** ${property["description"]} */\n");
  +            sink.write("\n  /** ${property["description"]} */\n");
             }
             if (array) {
  -            tmp.write("  core.List<$type> $propName;\n");
  +            sink.write("  core.List<$type> $propName;\n");
             } else {
  -            tmp.write("  $type $propName;\n");
  -          }
  -        }
  -      });
  -    }
  -
  -    tmp.write("\n");
  -    tmp.write("  /** Create new $name from JSON data */\n");
  -    tmp.write("  ${capitalize(name)}.fromJson(core.Map json) {\n");
  +            sink.write("  $type $propName;\n");
  +          }
  +        }
  +      });
  +    }
  +
  +    sink.write("\n");
  +    sink.write("  /** Create new $name from JSON data */\n");
  +    sink.write("  ${capitalize(name)}.fromJson(core.Map json) {\n");
       if (data.containsKey("properties")) {
         data["properties"].forEach((key, property) {
           var schemaType = property["type"];
  
positive.code:         var scopeName = scope.toUpperCase();
          if (p >= 0) scopeName = scopeName.substring(p+1);
          scopeName = cleanName(scopeName);
          tmp.write("\n");
          if (description.containsKey("description")) {
            tmp.write("  /** OAuth Scope2: ${description["description"]} */\n");
          } else {
            tmp.write("  /** OAuth Scope2 */\n");
          }
          tmp.write("  static const core.String ${scopeName}_SCOPE = \"$scope\";\n");
        });
      }
      if (_json.containsKey("parameters")) {
  
negative.code:       uploadCall = "null, content, contentType, urlParams: urlParams, queryParams: queryParams";
      }
  
      sink.write("    var response;\n");
      if (upload) {
        sink.write("    if (?content && content != null) {\n");
        sink.write("      response = ${noResource ? "this" : "_client"}.upload(uploadUrl, \"${data["httpMethod"]}\", $uploadCall);\n");
        sink.write("    } else {\n");
        sink.write("      response = ${noResource ? "this" : "_client"}.request(url, \"${data["httpMethod"]}\", $call);\n");
        sink.write("    }\n");
      } else {
        sink.write("    response = ${noResource ? "this" : "_client"}.request(url, \"${data["httpMethod"]}\", $call);\n");
      }
  
      if (data.containsKey("response")) {
        sink.write("    return response\n");
        sink.write("      .then((data) => new ${data["response"]["\$ref"]}.fromJson(data));\n");
      } else {
        sink.write("    return response;\n");
      }
      sink.write("  }\n");
    }
  
    void _writeResourceClass(StringSink sink, String name, Map data) {
      var className = "${capitalize(name)}Resource_";
  
      sink.write("class $className extends Resource {\n");
  
      if (data.containsKey("resources")) {
        sink.write("\n");
        data["resources"].forEach((key, resource) {
          var subClassName = "${capitalize(name)}${capitalize(key)}Resource_";
          sink.write("  $subClassName _$key;\n");
          sink.write("  $subClassName get $key => _$key;\n");
        });
      }
  
      sink.write("\n  $className(Client client) : super(client) {\n");
      if (data.containsKey("resources")) {
        data["resources"].forEach((key, resource) {
          var subClassName = "${capitalize(name)}${capitalize(key)}Resource_";
          sink.write("  _$key = new $subClassName(client);\n");
        });
      }
      sink.write("  }\n");
  
      if (data.containsKey("methods")) {
        data["methods"].forEach((key, method) {
          sink.write("\n");
          _writeMethod(sink, key, method);
        });
      }
  
      sink.write("}\n\n");
  
      if (data.containsKey("resources")) {
        data["resources"].forEach((key, resource) {
          _writeResourceClass(sink, "${capitalize(name)}${capitalize(key)}", resource);
        });
      }
    }
  