static JTask Required <TSource, TTarget>(this JTask jTask, Mapping <TSource, TTarget> mapping) { if (!jTask.TryCoerce(mapping)) { throw new MissingFieldException($"Required {mapping.Field} field not found in the JSON payload."); } return(jTask); }
static JTask Required <TSource, TTarget>(this JTask jTask, Mapping <TSource[], IList <TTarget> > mapping) { if (!jTask.TryCoerce(mapping)) { throw new MissingFieldException(mapping.Field); } return(jTask); }
static JTask Optional <TSource, TTarget>(this JTask jTask, Mapping <TSource, TTarget> mapping) { jTask.TryCoerce(mapping); return(jTask); }