|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using System; |
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
using System.Reflection; |
|
|
|
|
|
|
|
namespace Volo.Abp.Http.Modeling |
|
|
|
@ -12,6 +13,8 @@ namespace Volo.Abp.Http.Modeling |
|
|
|
|
|
|
|
public string TypeSimple { get; set; } |
|
|
|
|
|
|
|
public bool IsRequired { get; set; } |
|
|
|
|
|
|
|
//TODO: Validation rules for this property
|
|
|
|
public static PropertyApiDescriptionModel Create(PropertyInfo propertyInfo) |
|
|
|
{ |
|
|
|
@ -19,7 +22,8 @@ namespace Volo.Abp.Http.Modeling |
|
|
|
{ |
|
|
|
Name = propertyInfo.Name, |
|
|
|
Type = ApiTypeNameHelper.GetTypeName(propertyInfo.PropertyType), |
|
|
|
TypeSimple = ApiTypeNameHelper.GetSimpleTypeName(propertyInfo.PropertyType) |
|
|
|
TypeSimple = ApiTypeNameHelper.GetSimpleTypeName(propertyInfo.PropertyType), |
|
|
|
IsRequired = propertyInfo.IsDefined(typeof(RequiredAttribute), true) |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|