Add responses field to Link Object to describe expected responses of a linked operation post-link execution #4751
Replies: 1 comment 2 replies
-
@elmanm Thank you for the proposal! I think this is an aspect of the general problem of correlating requests and responses, with the link context being an additional input. Although I suspect that every request that comes in via link could be correlated by its request shape alone, regardless of whether the client was prompted to make that request by a link or not. I am also curious as to how Arazzo (OpenAPI Workflows) fits here. Is this something that can be better expressed in Arazzo? The Link Object is a bit of an oddity now, as it does not seem to have been widely adopted, and (AFAICT- @frankkilcommins would know better) is mostly made obsolete by Arazzo. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
This proposal suggests adding an optional
responses
field to theLink Object
, using the same structure as theResponse Object
, that allows an API to specify a context-specific subset of the linked operation's possible respones. This gives downstream consumers clearer expectations in workflows and chains of operations.Motivation
In OpenAPI, an operation's
responses
object describes the complete set of possible responses under any circumstances. However, in actual usage, only a subset of those responses are realistic given previous actions taken. For example:GET
for that resource may return404
, and not200
This proposal gives API authors a way to formally capture these contextual expectations within the existing
Linked Object
Proposal
Add an optional
responses
field to theLink Object
, reusing the structure of theResponse Object
.Each status code:
Any status code not listed is implicitly not expected in this context
Example
Benefits
Alternatives
description
fields. However, these cannot be parsed or utilised meaningfully by tools or UIs.Beta Was this translation helpful? Give feedback.
All reactions