Skip to content

Commit 7724607

Browse files
authored
Merge pull request OAI#951 from OAI/dm/link-corrections
Updates to link object and link parameter objects
2 parents fa603c0 + f0594a4 commit 7724607

File tree

1 file changed

+39
-24
lines changed

1 file changed

+39
-24
lines changed

versions/3.0.md

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,25 +1860,21 @@ The presence of a link does not guarantee the caller's ability to successfully i
18601860

18611861
As opposed to _dynamic_ links (links provided **in** the response payload), the OAS linking mechanism does not require that link information be provided in a specific response format at runtime.
18621862

1863-
For computing links, and providing instructions to execute them, a mechanism is defined for accessing values in a response and using them as variables while invoking the linked operation.
1864-
1865-
Field Name | Type | Description
1866-
---|:---:|---
1867-
<a name="referenceRef"></a>$ref | `string` | If present, a reference to another Links Object. Note, the presence of `$ref` in the Links Object will cause all _Patterned Objects_ to be ignored.
1863+
For computing links, and providing instructions to execute them, [variable substitution](#variableSubstitution) is used for accessing values in a response and using them as values while invoking the linked operation.
18681864

1865+
##### Patterned Fields
18691866
Field Pattern | Type | Description
18701867
---|:---:|---
1871-
<a name="linkName"></a>link name | [Link Object](#linkObject) <span>&#124;</span> [Reference Object](#referenceObject)] | A short name for the link, following the naming constraints of the names for [Component Objects](#componentsObject).
1868+
<a name="linkName"></a> {name} | [Link Object](#linkObject) <span>&#124;</span> [Reference Object](#referenceObject) | A short name for the link, following the naming constraints of the names for [Component Objects](#componentsObject).
18721869
The link SHALL reference a single Link Object, or a JSON Reference to a single link object.
18731870

1874-
18751871
#### <a name="#linkObject"></a>Link Object
18761872
The `Link Object` is responsible for defining a possible operation based on a single response.
18771873

18781874
Field Name | Type | Description
18791875
---|:---:|---
18801876
href | `string` | a relative or absolute URL to a linked resource. This field is mutually exclusive with the `operationId` field.
1881-
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.
1877+
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](#operationObject) in the OAS.
18821878
parameters | [Link Parameters Object](#linkParametersObject) | an object representing parameters to pass to an operation as specified with `operationId` or identified via `href`.
18831879
headers | [Headers Object](#headersObject) | an object representing headers to pass to the linked resource. Where conflicts occur between these headers, and those defined in the related operation, these headers override.
18841880
description | `string` | a description of the link, supports [CommonMark syntax](http://spec.commonmark.org/).
@@ -2053,9 +2049,10 @@ paths:
20532049
operationId: getUserByName
20542050
parameters:
20552051
- name: username
2056-
type: string
20572052
in: path
20582053
required: true
2054+
schema:
2055+
type: string
20592056
responses:
20602057
200:
20612058
description: The User
@@ -2071,9 +2068,10 @@ paths:
20712068
operationId: getRepositoriesByOwner
20722069
parameters:
20732070
- name: username
2074-
type: string
20752071
in: path
20762072
required: true
2073+
schema:
2074+
type: string
20772075
responses:
20782076
200:
20792077
description: repositories owned by the supplied user
@@ -2094,10 +2092,13 @@ paths:
20942092
type: string
20952093
in: path
20962094
required: true
2095+
schema:
2096+
type: string
20972097
- name: slug
2098-
type: string
20992098
in: path
21002099
required: true
2100+
schema:
2101+
type: string
21012102
responses:
21022103
200:
21032104
description: The repository
@@ -2113,20 +2114,23 @@ paths:
21132114
operationId: getPullRequestsByRepository
21142115
parameters:
21152116
- name: username
2116-
type: string
21172117
in: path
21182118
required: true
2119+
schema:
2120+
type: string
21192121
- name: slug
2120-
type: string
21212122
in: path
21222123
required: true
2124+
schema:
2125+
type: string
21232126
- name: state
2124-
type: string
21252127
in: query
2126-
enum:
2127-
- open
2128-
- merged
2129-
- declined
2128+
schema:
2129+
type: string
2130+
enum:
2131+
- open
2132+
- merged
2133+
- declined
21302134
responses:
21312135
200:
21322136
description: an array of pull request objects
@@ -2141,17 +2145,20 @@ paths:
21412145
operationId: getPullRequestsById
21422146
parameters:
21432147
- name: username
2144-
type: string
21452148
in: path
21462149
required: true
2150+
schema:
2151+
type: string
21472152
- name: slug
2148-
type: string
21492153
in: path
21502154
required: true
2155+
schema:
2156+
type: string
21512157
- name: pid
2152-
type: string
21532158
in: path
21542159
required: true
2160+
schema:
2161+
type: string
21552162
responses:
21562163
200:
21572164
description: a pull request object
@@ -2166,17 +2173,20 @@ paths:
21662173
operationId: mergePullRequest
21672174
parameters:
21682175
- name: username
2169-
type: string
21702176
in: path
21712177
required: true
2178+
schema:
2179+
type: string
21722180
- name: slug
2173-
type: string
21742181
in: path
21752182
required: true
2183+
schema:
2184+
type: string
21762185
- name: pid
2177-
type: string
21782186
in: path
21792187
required: true
2188+
schema:
2189+
type: string
21802190
responses:
21812191
204:
21822192
description: the PR was successfully merged
@@ -2262,6 +2272,11 @@ Many operations require parameters to be passed, and these MAY be dynamic depend
22622272
To specify parameters required by the operation, we can use a **Link Parameters Object**.
22632273
This object contains parameter names along with static or dynamic values:
22642274

2275+
##### Patterned Fields
2276+
Field Pattern | Type | Description
2277+
---|:---:|---
2278+
<a name="linkParameterName"></a> {name} | Any <span>&#124;</span> [{expression}](#variableSubstitution) | A constant value or expression to be evaluated and passed to the linked operation.
2279+
22652280
```yaml
22662281
paths:
22672282
/user/{username}: # ...

0 commit comments

Comments
 (0)