Sky
unread,Feb 23, 2012, 4:01:37 AM2/23/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to JSDoc Users
My project receives JSON data in an expected format. I want to
document that format in the definition of the function that receives
the data. The data is deeply nested. I've managed to resolve most of
the quandaries that I've had, but I'm not sure how to go about the
following:
Sometimes an object does not have a single name, but is a type of
names, which in turn has sub properties. How do I document this
situation?
EG:
// The JSON data passed in. Pasted here for demonstration.
an_obj = {
users : {
username1 : {
param1 : "a value",
param2 : "a value"
},
username2 : {
param1 : "a value",
param2 : "a value"
}
//... more usernames here
}
}
/**
* A function description.
* @param {object} obj
* @param {object} obj.users A collection of user data.
* @param {object} obj.users.username !!!! This is not the object
name, but a name type. How do I signify this !!!!
* @param {string} obj.users.username.param1 Desc..
* @param {string} obj.users.username.param2 Desc...
*/
var myFunc = function(obj){
//...
};