Relative Content

Tag Archive for expressswaggerswagger-uijsdocswagger-jsdocs

Route params not populating properly from Swagger UI in ExpressJs api

I am implementing Swagger into an ExpressJs API application. In the controller files, we are using nested folders and “const router = require(‘express’).Router({ mergeParams: true });” to inherit path variables from parent folders. When I run my swagger implementation, anything deeper than the parent folder will not dynamically put in the route variables provided from the swagger UI. Example: I will put in the variables “mineID’ and “incidentId” from the text boxes in swagger ui, then this is the exact curl request shown in swagger ui, where you can see that the second route parameter has not been filled as it should have been from the UI: