The OpenAPI v3 links feature allows specifying related operations. To me, however, the spec was not clear on whether it's possible and if, how to define links that require an additional variable for the call.
To give a practical example, assume there's a GET /users operation to list all users and a GET /users/{id} operation to get details about an individual user. I could add the latter as a link to the former but this link requires an additional piece of information, specifically which user from the list I want to receive details for.
{
"links" : {
"details" : {
"operationId" : "getUserDetails",
"parameters": {
"id" : "$response.body#/*/id"
}
}
}
}
Is that possible or even desired to express with the links feature? If yes, is * the right syntax for a placeholder in JSON pointer? If not, is there another way?
The OpenAPI v3 links feature allows specifying related operations. To me, however, the spec was not clear on whether it's possible and if, how to define links that require an additional variable for the call.
To give a practical example, assume there's a GET
/usersoperation to list all users and a GET/users/{id}operation to get details about an individual user. I could add the latter as a link to the former but this link requires an additional piece of information, specifically which user from the list I want to receive details for.{ "links" : { "details" : { "operationId" : "getUserDetails", "parameters": { "id" : "$response.body#/*/id" } } } }Is that possible or even desired to express with the links feature? If yes, is
*the right syntax for a placeholder in JSON pointer? If not, is there another way?