express-jsdoc-swagger icon indicating copy to clipboard operation
express-jsdoc-swagger copied to clipboard

[BUG] param annotation with brackets

Open g-portugues opened this issue 4 years ago • 1 comments

Hello,

In my application I use query params with brackets in the name. When documenting these parameters with the @param annotation it is not considered when generating the documentation (http://localhost:8000/examples?filter[limit]=10&filter[offset]=1).

/**
 * GET /examples
 * @summary This is the summary of the endpoint
 * @description This is the description of the endpoint
 * @tags Examples
 * @param {integer} filter[limit].query - limit description here
 * @param {integer} filter[offset].query - offset description here
 * @return {array<Example>} 200 - Examples list
 */

Perhaps a way to solve the problem is to implement the RecordType of @types/doctrine so that it accepts the following structure:

/**

  • GET /examples
  • @summary This is the summary of the endpoint
  • @description This is the description of the endpoint
  • @tags Examples
  • @param {{filter:integer}} limit.query - limit description here
  • @param {{filter:integer}} offset.query - offset description here
  • @return {array<Example>} 200 - Examples list */

g-portugues avatar Oct 05 '21 20:10 g-portugues

Hi @g-portugues could you solve it with the definition you shared?

kevinccbsg avatar Jul 27 '22 19:07 kevinccbsg