You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versions/3.0.md
+19-1Lines changed: 19 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1173,7 +1173,8 @@ The `Link Object` is responsible for defining a possible operation based on a si
1173
1173
1174
1174
Field Name | Type | Description
1175
1175
---|:---:|---
1176
-
href | url | a relative or absolute URL to a linked resource. This field is mutually exclusive with the `operationId` field.
1176
+
href | url | a relative or absolute URL to a linked resource definition. This field is mutually exclusive with the `operationId` field.
1177
+
url | url | a relative or absolute URL representing the target location for the link operation. This is used to override the `{scheme}://{host}/{basePath}` defined at the global level for the linked operation.
1177
1178
operationId | string | the name of an _existing_, resolvable OAS operation, as defined with a unique `operationId`. This field is mutually exclusive with the `href` field. Relative `href` values _may_ be used to locate an existing Operation Object in the OAS.
1178
1179
parameters | Link Parameters Object | an Object representing parameters to pass to an operation as specified with `operationId` or identified via `href`.
1179
1180
headers | Link Headers Object | an Object representing headers to pass to the linked resource.
@@ -1184,6 +1185,23 @@ Locating a linked resource may be performed by either a `href` or `operationId`.
1184
1185
In the case of an `operationId`, it must be unique and resolved in the scope of the OAS document.
1185
1186
Because of the potential for name clashes, consider the `href` syntax as the preferred method for specifications with external references.
1186
1187
1188
+
When the `url` attribute is provided, the target host may be overridden by the value provided. For example:
1189
+
1190
+
```
1191
+
components:
1192
+
links:
1193
+
UserRepositories:
1194
+
operationId: getRepositoriesByOwner
1195
+
url: $responseHeaders.link
1196
+
definitions:
1197
+
user:
1198
+
type: object
1199
+
```
1200
+
1201
+
will extract the URL from the response header named `link`. If an absolute URL is provided, it will be used instead of the server / path provided in the target operation. Parameters _may_ be provided as well. If a `path` parameter is provided, it shall be ignored unless the `url` value contains a matching location for substitution. If query parameters are provided in the `url` value, they will be interpreted per the operation definition, and the absence of a required query parameter will result in an invalid request.
1202
+
1203
+
When a relative path is provided in the `url` attribute, the host defined in the specification will be used.
0 commit comments