Got this option for my route, when acessing the first param (page) it returns properly the value typed in from swagger ui when it access the second param (genre), it literraly interprets it as a string ‘{genre}’. any thoughts, pls?
app.get('/movies/:page/genres/:genre', (req,res) => {// route logic})
swagger options object
'/movies/{page}/genres/{genre}': {
get: {
security: [{
myAuth: []
}],
parameters: [
{
in: 'path',
name: "page",
required: true,
type: "string",
},
{
in: 'path',
name: "genre",
required: true,
type: "string",
},
],
I tried reading the swagger docs for getting the solution but it looks right to me.
Guilherme G is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
when acessing the first param (page) it returns properly the value typed in from swagger ui when it access the second param (genre), it literraly interprets it as a string ‘{genre}’
It was a bug in Swagger UI v. 5.17.7 that was fixed in v. 5.17.8.
1
Neither one should work because you don’t have schema
defined for either parameter.
Try this…
parameters: [
{
in: 'path',
name: "page",
required: true,
schema: {
type: "string"
},
},
{
in: 'path',
name: "genre",
required: true,
schema: {
type: "string"
},
},
],
2