0

I'm using Parse for a mobile app, I have a few Cloud Code functions and I want to generate documentation using JSDoc.

If I do this:

/** This is a Cloud Code function */
Parse.Cloud.define('foo', function(request, response){
});

JSDoc does not generate the documentation.

However, doing this works:

/** This is a javascript function */
function foo() {
}

Is it possible to document my Cloud Code functions?

Edu
  • 1,089
  • 7
  • 12

2 Answers2

1

Well, the solution was pretty simple:

/** Document your Cloud Code function as a JS function */
var foo = function(request, response) {
}

//Then define it on Parse.Cloud
Parse.Cloud.define('foo', foo);

Hope this helps someone.

Edu
  • 1,089
  • 7
  • 12
1

You can also mark that using @method property:

/** 
 * Document your Cloud Code function as a JS function 
 * @method foo
 */
Parse.Cloud.define('foo', function(request, response) {
  //...
});
wzs
  • 1,057
  • 9
  • 12