nabeel-ahmad / express-mongoose-docs

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

Duplicate models #13

Open robblovell opened 7 years ago

robblovell commented 7 years ago

In situations where two schemas reuse another schema, the generated documentation shows the reused schema multiple times rather than showing only one instance of that reused schema.

For example, ContextSchema will show twice in the documentation in two different places. (in coffeescript below)

Schema = require('mongoose').Schema
ContextSchema = new Schema(
    {
        name: String,
        sku: { type: String, index: true }
    },
    { strict: false, _id: false }
)
RuleContextSchema = new Schema(
  {
    context: [ContextSchema]
  }
  {strict: false}
)
FactContextSchema = new Schema(
    {
        context: [ContextSchema]
    },
    { strict: false }
)