Closed mopaul closed 7 years ago
I meant referencing a parameter in the path.parameter section. Something like this.
"paths":{
"/a":{
"get":{
"parameters":[
{
"name":"p2",
"in":"body",
"schema":{
"$ref":"#/definitions/d1"
}
}
],
"responses":{
"default":{
"$ref":"#/responses/r1"
}
}
},
"parameters": [
{
"$ref":"#/parameters/p1"
},
{
"$ref":"#/parameters/p2"
}
]
}
}
The parameters p1 and p2 are being referenced from the path.parameters and not operation.parameters. I can only see p2 and p1_d associated with the operation but (if I understand the swagger spec correctly), p2, p1_d and p2_d are all valid parameters.
Let me know if you want me to send a PR with a test case.
The case you described is new to me, and yes, it's spec compliant. Any PR with test case is welcome, thanks.
OK, thanks. I'll work on this part tomorrow evening.
this bug is fixed in v0.8.26, please feel free to reopen it when it's still failed.
Fix verified. Thanks for your quick responses.
My swagger definition defines a bunch of query parameters in the root.parameters which I then reference from the pathItem.parameters section. When I try to access the operation parameters using app.op.parameters, it looks like only the 1st parameter referenced in pathItem.parameters is associated with the path's Operation object.
If I understand the swagger definition, pathItems.parameters are applicable to all the operations in the path.
Am I missing something?
Referencing a parameter from operation.parameters works as expected.