I'm trying to document mongoose model methods with jsdoc. A model's method belongs to the model, thus I would like to see it as it's member method.
The file contains a top level @module models line as well.
/**
* @constructor
*/
var MySchema = new Schema({
title: {
type: String,
required: true
}
});
/**
* My method
*
* @function myMethod
* @memberof MySchema
* @this MySchema
* @param {ObjectId} object
* @params {Array} roles, defaults to all
* @returns Participant or null
*/
MySchema.method('myMethod', function(object, roles) {
// ...
});
Currently I receive a module page that contains a link to my class definition, and a page documenting the class definition, but the method does not appear on any of these pages. When I remove @memberof, then the method appears on the module page. I would like to have it on the class page though.
What part of the jsdoc docs am I missing?