vmarchaud / jsdoc-http-plugin

Document your http endpoints with JSDoc
MIT License
40 stars 10 forks source link

Params Not Being Documented for Express Endpoints #17

Closed SudoZachCampbell closed 4 years ago

SudoZachCampbell commented 4 years ago

Having an issue when @params are not showing in the following Express code:

/** Get object by ID endpoint
 * 
 * @name Fields by ID
 * @memberof Field APIs
 * @path {GET} /fields/:objectId
 * @params {String} :objectId is the Field ID to search by
 */
router.get('/:objectId', (req, res, next) => {
  fieldsSvc.getItem(req.params.objectId, 'Fields').then((data) => {
    res.json(data);
  }).catch(next);
});

I tried removing the namespace to see if it was affecting it but no change.

vmarchaud commented 4 years ago

Could you share what does it show when exporting it ?

SudoZachCampbell commented 4 years ago

image

SudoZachCampbell commented 4 years ago

Resolved the issue, in the plugins section in my jsdoc config I had to put "node_modules/jsdoc-http-plugin". Could possibly be due to the location of the jsdoc config file inside a "config" directory, however in that case I thought the fix would be "../node_modules/jsdoc-http-plugin"