static string GetDefaultValue(Parameter x) { if (!x.Type.IsNullableType && x.CollectionFormat != "multi" && x.Type.EnumValues != null && x.Type.EnumValues.Any()) { return string.Format("{0}.{1}", x.Type.TypeName, x.Type.EnumValues.FirstOrDefault()); } return "null"; }
static string GetDefaultType(Parameter x) { var typeName = x.Type.TypeName; if (typeName == "file") { return "Tuple<string, byte[]>"; } if (x.Type.IsNullableType) typeName += "?"; var output = x.CollectionFormat == "multi" ? string.Format("List<{0}>", typeName) : typeName; return output; }