private string BuildPropertyCommon(PropertyInfo prop, IEnumerable <CustomAttributeData> customAttributes) { var name = TypeBuilderHelper.GetPropertyName(prop); var res = "\"" + name + "\": { \"type\": " + SchemaTypeMapper.GetAttribute(prop.PropertyType); res += HandleRequiredAttribute(prop, customAttributes); res += HandleValidationAttributes(customAttributes); return(res); }
protected string GetNestedArraySchemaPrimitiveType(int pad, Type elementType) { var arraySchema = "{\r\n".Indent(pad) + " \"type\": \"array\",\r\n".Indent(pad) + " \"items\": \r\n".Indent(pad) + " {\r\n".Indent(pad) + (" \"type\": " + SchemaTypeMapper.GetAttribute(elementType) + "\r\n").Indent(pad) + " }\r\n".Indent(pad) + "}\r\n".Indent(pad); return(arraySchema); }