public ObjectSchema WithOptionalProperty(string name, object type, params IValidationRule[] rules) { Properties = Properties ?? new List <PropertySchema>(); var schema = new PropertySchema(name, type) { Rules = new List <IValidationRule>(rules) }; schema.MakeOptional(); return(WithProperty(schema)); }
public ObjectSchema WithProperty(PropertySchema schema) { Properties = Properties ?? new List <PropertySchema>(); Properties.Add(schema); return(this); }