Conditionalrequired

Per request moved from 3.8.x to master (see  #2220)
(Git is great but extremely difficult when you lack the experience; hope I didn't cause any trouble)

Conditional required: allows the value for required to be a callback:
name : { type: String, required: function () { /* this is doc */ return true/false; } }