Skip to content

Commit d380b8d

Browse files
committed
Clarify Link Obj parameters as best we can (3.0.4)
This acknowledges the ambiguity in the key and value syntax of the Link Object's `parameter` field, and provides a bit of guidance on how to implement it. Sadly it is not possible to fully solve in a point release.
1 parent bb25ab7 commit d380b8d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

versions/3.0.4.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2060,7 +2060,7 @@ Field Name | Type | Description
20602060
---|:---:|---
20612061
<a name="linkOperationRef"></a>operationRef | `string` | A relative or absolute URI reference to an OAS operation. This field is mutually exclusive of the `operationId` field, and MUST point to an [Operation Object](#operationObject). Relative `operationRef` values MAY be used to locate an existing [Operation Object](#operationObject) in the OpenAPI definition.
20622062
<a name="linkOperationId"></a>operationId | `string` | The name of an _existing_, resolvable OAS operation, as defined with a unique `operationId`. This field is mutually exclusive of the `operationRef` field.
2063-
<a name="linkParameters"></a>parameters | Map[`string`, Any \| [{expression}](#runtimeExpression)] | A map representing parameters to pass to an operation as specified with `operationId` or identified via `operationRef`. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation. The parameter name can be qualified using the [parameter location](#parameterIn) `[{in}.]{name}` for operations that use the same parameter name in different locations (e.g. path\.id).
2063+
<a name="linkParameters"></a>parameters | Map[`string`, Any \| [{expression}](#runtimeExpression)] | A map representing parameters to pass to an operation as specified with `operationId` or identified via `operationRef`. The key is the parameter name to be used, whereas the value can be a constant or an expression to be evaluated and passed to the linked operation (see further details below).
20642064
<a name="linkRequestBody"></a>requestBody | Any \| [{expression}](#runtimeExpression) | A literal value or [{expression}](#runtimeExpression) to use as a request body when calling the target operation.
20652065
<a name="linkDescription"></a>description | `string` | A description of the link. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
20662066
<a name="linkServer"></a>server | [Server Object](#serverObject) | A server object to be used by the target operation.
@@ -2072,6 +2072,16 @@ In the case of an `operationId`, it MUST be unique and resolved in the scope of
20722072
Because of the potential for name clashes, the `operationRef` syntax is preferred
20732073
for specifications with external references.
20742074

2075+
Keys and values for `parameters` have multiple syntaxes:
2076+
2077+
* The key can either be just the parameter name, or can be qualified using the [parameter location](#parameterIn) `[{in}.]{name}` for operations that use the same parameter name in different locations (e.g. path\.id).
2078+
* The value can be a literal value or a [Runtime Expression](#runtimeExpression)
2079+
2080+
Certain keys and values for `parameters` can be ambiguous, in which case their handling is implementation-defined as it was not spelled out in earlier versions of OAS 3.0. However, it is RECOMMENDED that:
2081+
2082+
* Keys that match unqualified parameter names be treated as those names, as a parameter that is (confusingly) named to appear qualified (e.g. `path\.id`) can be qualified to disambiguate it (e.g. `path\.path\.id`)
2083+
* Values that are valid runtime expressions be handled as runtime expressions, although this means that it is not possible to pass a literal value that looks like a runtime expression
2084+
20752085
##### Examples
20762086

20772087
Computing a link from a request operation where the `$request.path.id` is used to pass a request parameter to the linked operation.

0 commit comments

Comments
 (0)