-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameter referencing in PathItemObject.parameters. #105
Comments
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. |
PR 106 has the test case. |
OK, thanks. I'll work on this part tomorrow evening. |
#105 - should always use “final” property when a field is either “some object” or “reference object” - another bug found during fixing this issue: update ‘parameters’ in for loop
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. |
pyopenapi/pyswagger#105 - should always use “final” property when a field is either “some object” or “reference object” - another bug found during fixing this issue: update ‘parameters’ in for loop
- pyopenapi/pyswagger#105 Parameter referencing in PathItemObject.parameters.
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.
The text was updated successfully, but these errors were encountered: