private void SerializeParameter(StringBuilder sb, KeyValuePair <string, Parameter> parameter, int indentation) { sb.AppendFormat("{0}:".Indent(indentation), parameter.Key); sb.AppendLine(); RamlSerializerHelper.SerializeParameterProperties(sb, parameter.Value, indentation); }
private void SerializeMethod(StringBuilder sb, Method method, int indentation) { sb.AppendLine((method.Verb + ":").Indent(indentation)); RamlSerializerHelper.SerializeDescriptionProperty(sb, method.Description, indentation + 2); //SerializeType(sb, method.Type, indentation + 2); if (method.Headers != null) { sb.AppendLine("headers:".Indent(indentation + 2)); foreach (var header in method.Headers) { sb.AppendLine(header.Key + ":".Indent(indentation + 4)); RamlSerializerHelper.SerializeParameterProperties(sb, header.Value, indentation + 6); } } SerializeArrayProperty(sb, "is", method.Is, indentation + 2); SerializeProtocols(sb, method.Protocols, indentation + 2); SerializeArrayProperty(sb, "securedBy", method.SecuredBy, indentation + 2); SerializeParameters(sb, "baseUriParameters", method.BaseUriParameters, indentation + 2); SerializeParameters(sb, "queryParameters", method.QueryParameters, indentation + 2); SerializeBody(sb, method.Body, indentation + 2); SerializeResponses(sb, method.Responses, indentation + 2); raml1TypesSerializer.SerializeAnnotations(sb, method.Annotations, indentation + 2); }