Skip to content

Commit 79408c8

Browse files
author
Ron
authored
Merge branch 'OpenAPI.next' into multi-media
2 parents 556dda7 + 8d115b7 commit 79408c8

File tree

4 files changed

+505
-394
lines changed

4 files changed

+505
-394
lines changed

CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
* Darrel Miller [@darrelmiller](https://github.com/darrelmiller)
22
* Jason Harmon [@jharmn](https://github.com/jharmn)
33
* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc)
4+
* Kris Hahn [@KrisHahn](https://github.com/krishahn)
45
* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh)
6+
* Mike Ralphson [@MikeRalphson](https://github.com/mikeralphson)
57
* Rob Dolin [@RobDolinMS](https://github.com/robdolinms)
68
* Ron Ratovsky [@webron](https://github.com/webron)
79
* Tony Tam [@fehguy](https://github.com/fehguy)

examples/v3.0/callback-example.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
paths:
2+
/streams:
3+
post:
4+
description: subscribes a client to receive out-of-band data
5+
parameters:
6+
- name: callbackUrl
7+
in: query
8+
required: true
9+
description: |
10+
the ___location where data will be sent. Must be network accessible
11+
by the source server
12+
schema:
13+
type: string
14+
format: uri
15+
example: https://tonys-server.com
16+
responses:
17+
'201':
18+
description: subscription successfully created
19+
content:
20+
application/json:
21+
schema:
22+
description: subscription information
23+
required:
24+
- subscriptionId
25+
properties:
26+
subscriptionId:
27+
description: this unique identifier allows management of the subscription
28+
type: string
29+
example: 2531329f-fb09-4ef7-887e-84e648214436
30+
callbacks:
31+
# the name `onData` is a convenience locator
32+
onData:
33+
# when data is sent, it will be sent to the `callbackUrl` provided
34+
# when making the subscription PLUS the suffix `/data`
35+
{$request.query.callbackUrl}/data:
36+
post:
37+
requestBody:
38+
description: subscription payload
39+
content:
40+
application/json:
41+
schema:
42+
properties:
43+
timestamp:
44+
type: string
45+
format: date-time
46+
userData:
47+
$ref: '#/components/schemas/UserLogData'
48+
responses:
49+
'202':
50+
description: |
51+
Your server implementation should return this HTTP status code
52+
if the data was received successfully
53+
'204':
54+
description: |
55+
Your server should return this HTTP status code if no longer interested
56+
in further updates

examples/v3.0/link-example.yaml

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
openapi: 3.0.0
2+
info:
3+
title: Link Example
4+
version: 1.0.0
5+
paths:
6+
/2.0/users/{username}:
7+
get:
8+
operationId: getUserByName
9+
parameters:
10+
- name: username
11+
in: path
12+
required: true
13+
schema:
14+
type: string
15+
responses:
16+
'200':
17+
description: The User
18+
content:
19+
application/json:
20+
schema:
21+
$ref: '#/components/schemas/user'
22+
links:
23+
userRepositories:
24+
$ref: '#/components/links/UserRepositories'
25+
/2.0/repositories/{username}:
26+
get:
27+
operationId: getRepositoriesByOwner
28+
parameters:
29+
- name: username
30+
in: path
31+
required: true
32+
schema:
33+
type: string
34+
responses:
35+
'200':
36+
description: repositories owned by the supplied user
37+
content:
38+
application/json:
39+
schema:
40+
type: array
41+
items:
42+
$ref: '#/components/schemas/repository'
43+
links:
44+
userRepository:
45+
$ref: '#/components/links/UserRepository'
46+
/2.0/repositories/{username}/{slug}:
47+
get:
48+
operationId: getRepository
49+
parameters:
50+
- name: username
51+
in: path
52+
required: true
53+
schema:
54+
type: string
55+
- name: slug
56+
in: path
57+
required: true
58+
schema:
59+
type: string
60+
responses:
61+
'200':
62+
description: The repository
63+
content:
64+
application/json:
65+
schema:
66+
$ref: '#/components/schemas/repository'
67+
links:
68+
repositoryPullRequests:
69+
$ref: '#/components/links/RepositoryPullRequests'
70+
/2.0/repositories/{username}/{slug}/pullrequests:
71+
get:
72+
operationId: getPullRequestsByRepository
73+
parameters:
74+
- name: username
75+
in: path
76+
required: true
77+
schema:
78+
type: string
79+
- name: slug
80+
in: path
81+
required: true
82+
schema:
83+
type: string
84+
- name: state
85+
in: query
86+
schema:
87+
type: string
88+
enum:
89+
- open
90+
- merged
91+
- declined
92+
responses:
93+
'200':
94+
description: an array of pull request objects
95+
content:
96+
application/json:
97+
schema:
98+
type: array
99+
items:
100+
$ref: '#/components/schemas/pullrequest'
101+
/2.0/repositories/{username}/{slug}/pullrequests/{pid}:
102+
get:
103+
operationId: getPullRequestsById
104+
parameters:
105+
- name: username
106+
in: path
107+
required: true
108+
schema:
109+
type: string
110+
- name: slug
111+
in: path
112+
required: true
113+
schema:
114+
type: string
115+
- name: pid
116+
in: path
117+
required: true
118+
schema:
119+
type: string
120+
responses:
121+
'200':
122+
description: a pull request object
123+
content:
124+
application/json:
125+
schema:
126+
$ref: '#/components/schemas/pullrequest'
127+
links:
128+
pullRequestMerge:
129+
$ref: '#/components/links/PullRequestMerge'
130+
/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge:
131+
post:
132+
operationId: mergePullRequest
133+
parameters:
134+
- name: username
135+
in: path
136+
required: true
137+
schema:
138+
type: string
139+
- name: slug
140+
in: path
141+
required: true
142+
schema:
143+
type: string
144+
- name: pid
145+
in: path
146+
required: true
147+
schema:
148+
type: string
149+
responses:
150+
'204':
151+
description: the PR was successfully merged
152+
components:
153+
links:
154+
UserRepositories:
155+
# returns array of '#/components/schemas/repository'
156+
operationId: getRepositoriesByOwner
157+
parameters:
158+
username: $response.body#/username
159+
UserRepository:
160+
# returns '#/components/schemas/repository'
161+
operationId: getRepository
162+
parameters:
163+
username: $response.body#/owner/username
164+
slug: $response.body#/slug
165+
RepositoryPullRequests:
166+
# returns '#/components/schemas/pullrequest'
167+
operationId: getPullRequestsByRepository
168+
parameters:
169+
username: $response.body#/owner/username
170+
slug: $response.body#/slug
171+
PullRequestMerge:
172+
# executes /2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge
173+
operationId: mergePullRequest
174+
parameters:
175+
username: $response.body#/author/username
176+
slug: $response.body#/repository/slug
177+
pid: $response.body#/id
178+
schemas:
179+
user:
180+
type: object
181+
properties:
182+
username:
183+
type: string
184+
uuid:
185+
type: string
186+
repository:
187+
type: object
188+
properties:
189+
slug:
190+
type: string
191+
owner:
192+
$ref: '#/components/schemas/user'
193+
pullrequest:
194+
type: object
195+
properties:
196+
id:
197+
type: integer
198+
title:
199+
type: string
200+
repository:
201+
$ref: '#/components/schemas/repository'
202+
author:
203+
$ref: '#/components/schemas/user'

0 commit comments

Comments
 (0)