Skip to content

Variables/Parameters in Links #1327

@LukasRos

Description

@LukasRos

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Moved to MoonwalkIssues that can be closed or migrated as being addressed in Moonwalklinks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions