nabeel-ahmad / express-mongoose-docs

Auto-generated Documentation for Express and Mongoose based APIs
Other
38 stars 20 forks source link

Conditional requirements are listed as required #15

Open AdamGerthel opened 6 years ago

AdamGerthel commented 6 years ago

Mongoose allow functions that return true or false as value for the required key:

    thisIsAField: {
      type: String,
      required: function(value) {
        return whatever ? true : false
      }
    },

However, express-mongoose-docs lists this as a required field. I propose that field requirements that return a function are listed as "conditional" instead of "true".