Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to document object params with particular properties #88

Open
askmike opened this issue Dec 10, 2015 · 1 comment
Open

How to document object params with particular properties #88

askmike opened this issue Dec 10, 2015 · 1 comment

Comments

@askmike
Copy link

askmike commented Dec 10, 2015

I think I must be missing something here but I cannot figure out how to properly document object parameters (with specific properties). This is some documented code using jsdoc3:

/**
 * Transition the globe from its current position
 * to the new coordinates.
 *
 * @param  {Object} pos - the position
 * @param  {Float} pos.lat - latitude position
 * @param  {Float} pos.lon - longtitute position
 * @return  {this}
 */
api.center = function(pos) {
  target = calculate2dPosition(pos);
  return this;
}

Will output:

Globe.center(pos, pos.lat, pos.lon)

Transition the globe from its current position to the new coordinates.

Parameters
pos: Object, the position
pos.lat: Float, latitude position
pos.lon: Float, longtitute position
Returns: this

The first line is what I am not really happy about (this function only has a single parameter which is an object). After looking at the code it seems like something that is easily fixed by filtering the params before constructing the paramsString, but I am pretty sure that I am missing something obvious here.

@psq
Copy link
Contributor

psq commented Dec 14, 2015

@askmike I don't think you are missing anything. This part of the spec wasn't supported yet, and your patch looks good, although I'm not quite sure why the tests failed on the ci build. Will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants