public static string CreateJsObjectLiteral(ParameterApiDescriptionModel[] parameters, int indent = 0) { var sb = new StringBuilder(); sb.AppendLine("{"); foreach (var prm in parameters) { sb.AppendLine($"{new string(' ', indent)} '{prm.Name}': {GetParamNameInJsFunc(prm)}"); } sb.Append(new string(' ', indent) + "}"); return sb.ToString(); }
public ParameterApiDescriptionModel AddParameter(ParameterApiDescriptionModel parameter) { Parameters.Add(parameter); return(parameter); }
public ParameterApiDescriptionModel AddParameter(ParameterApiDescriptionModel parameter) { Parameters.Add(parameter); return parameter; }
public static string GetParamNameInJsFunc(ParameterApiDescriptionModel parameterInfo) { return parameterInfo.Name == parameterInfo.NameOnMethod ? NormalizeJsVariableName(parameterInfo.Name.ToCamelCase(), ".") : NormalizeJsVariableName(parameterInfo.NameOnMethod.ToCamelCase()) + "." + NormalizeJsVariableName(parameterInfo.Name.ToCamelCase(), "."); }