Lets say i have a validator that looks like this:
public class ThirdPartyInfoValidator : AbstractValidator<ThirdPartyInfo>
{
public ThirdPartyInfoValidator()
{
RuleSet(ApplyTo.Post, () =>
{
RuleFor(r => r.CaseId).NotEmpty();
RuleFor(r => r.ThirdPartyDescriptionId).NotEmpty();
RuleFor(r => r.Identifier).NotEmpty();
});
RuleSet(ApplyTo.Put, () =>
{
RuleFor(r => r.Id).NotEmpty();
RuleFor(r => r.CaseId).NotEmpty();
RuleFor(r => r.ThirdPartyDescriptionId).NotEmpty();
RuleFor(r => r.Identifier).NotEmpty();
});
RuleSet(ApplyTo.Delete, () =>
{
RuleFor(r => r.Id).NotEmpty();
RuleFor(r => r.CaseId).NotEmpty();
});
}
}
it would be awesome if that validation information would be automatically processed (assuming autoscan == true) and pulled into the /metadata page, reflecting when properties are required for GET vs POST vs PUT, etc.