Skip to content

Commit 5a17b01

Browse files
committed
Improve Link Object Examples
Ports from 3.1 the Link Object example description improvements. The related section tweaks were included in the larger 3.2 section reorganization.
1 parent 690560b commit 5a17b01

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/oas.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2652,8 +2652,10 @@ solely by the existence of a relationship.
26522652
26532653
##### `operationRef` Examples
26542654

2655-
As references to `operationId` MAY NOT be possible (the `operationId` is an optional
2656-
field in an [Operation Object](#operation-object)), references MAY also be made through a relative `operationRef`:
2655+
As the `operationId` is an optional field in an [Operation Object](#operation-object), references MAY instead be made through a URI-reference with `operationRef`.
2656+
Note that both of these examples reference operations that can be identified via the [Paths Object](#paths-object) to ensure that the operation's path template is unambiguous.
2657+
2658+
A relative URI-reference `operationRef`:
26572659

26582660
```yaml
26592661
links:
@@ -2664,7 +2666,7 @@ links:
26642666
username: $response.body#/username
26652667
```
26662668

2667-
or a URI `operationRef`:
2669+
A non-relative URI `operationRef`:
26682670

26692671
```yaml
26702672
links:
@@ -2675,8 +2677,9 @@ links:
26752677
username: $response.body#/username
26762678
```
26772679

2678-
Note that in the use of `operationRef` the _escaped forward-slash_ is necessary when
2679-
using JSON Pointer, and it is necessary to URL-encode `{` and `}` as `%7B` and `%7D`, respectively, when using JSON Pointer as URI fragments.
2680+
Note that in the use of `operationRef` the _escaped forward-slash_ (`~1`) is necessary when
2681+
using JSON Pointer in URI fragments, and it is necessary to URL-encode `{` and `}` as `%7B` and `%7D`, respectively.
2682+
The unescaped, percent-decoded path template in the above examples would be `/2.0/repositories/{username}`.
26802683

26812684
#### Runtime Expressions
26822685

0 commit comments

Comments
 (0)