You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Description("比如tags=hello&tags=world")][FromQuery]publicstring[]?Tags{get;set;}[Description("querystring比如?member={\"id\":\"123\",\"userName\":\"vipwan\"}")][FromQuery(Name ="member")]
public Member CurrentMember { get; set; }
[Description("header比如{\"id\":\"123\",\"userName\":\"vipwan\"}")][FromHeader(Name="headmember")]public Member CurrentMemberFromHeader {get;set;}
public record Member(string Id,string UserName);//并且支持属性多级的校验
public HelloApiRequest(){
RuleFor(x=>x.CurrentMember.UserName).EmailAddress();//请注意多级验证务必添加When表达式
RuleFor(x=>x.CurrentMemberFromHeader.UserName).EmailAddress().When(x => x.CurrentMemberFromHeader!=null);}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: