-
Notifications
You must be signed in to change notification settings - Fork 731
Expand file tree
/
Copy pathopenapi.yaml
More file actions
323 lines (310 loc) · 9.15 KB
/
openapi.yaml
File metadata and controls
323 lines (310 loc) · 9.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
openapi: 3.1.0
info:
title: LFX Member Organization Affiliations API
version: 1.0.0
description: >
API for querying developer affiliation periods (work experiences) linked to
their verified GitHub identities in the LFX platform.
servers:
- url: /api/v1
description: Production
security:
- ApiKeyAuth: []
paths:
/affiliations:
post:
operationId: getBulkAffiliations
summary: Bulk contributor lookup
description: >
Look up affiliation data for up to 100 GitHub handles in a single
request. Handles that have no matching LFX profile are returned in the
`notFound` array.
tags:
- Affiliations
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- githubHandles
properties:
githubHandles:
type: array
description: List of GitHub login handles to look up (case-insensitive).
minItems: 1
maxItems: 100
items:
type: string
minLength: 1
example:
- torvalds
- gvanrossum
example:
githubHandles:
- torvalds
- gvanrossum
parameters:
- name: page
in: query
description: Page number (1-based).
required: false
schema:
type: integer
minimum: 1
default: 1
- name: pageSize
in: query
description: Number of contributors to return per page.
required: false
schema:
type: integer
minimum: 1
maximum: 100
default: 20
responses:
'200':
description: Affiliations resolved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/BulkAffiliationsResponse'
example:
total: 2
totalFound: 2
page: 1
pageSize: 20
contributorsInPage: 2
contributors:
- githubHandle: torvalds
name: Linus Torvalds
emails:
- torvalds@linux-foundation.org
affiliations:
- organization: Linux Foundation
startDate: '2007-01-01T00:00:00.000Z'
endDate: null
notFound: []
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/TooManyRequests'
/affiliations/{githubHandle}:
get:
operationId: getAffiliationByHandle
summary: Single contributor lookup
description: >
Convenience endpoint for looking up one developer by GitHub handle.
Useful for debugging and ad-hoc queries.
tags:
- Affiliations
parameters:
- name: githubHandle
in: path
required: true
description: GitHub login handle of the developer (case-insensitive).
schema:
type: string
minLength: 1
example: torvalds
responses:
'200':
description: Developer found.
content:
application/json:
schema:
$ref: '#/components/schemas/Contributor'
example:
githubHandle: torvalds
name: Linus Torvalds
emails:
- torvalds@linux-foundation.org
affiliations:
- organization: Linux Foundation
startDate: '2007-01-01'
endDate: null
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
description: No LFX profile found for the given GitHub handle.
content:
application/json:
schema:
$ref: '#/components/schemas/HttpError'
example:
error:
code: NOT_FOUND
message: "No LFX profile found for GitHub login 'nonexistent-user'."
'429':
$ref: '#/components/responses/TooManyRequests'
components:
securitySchemes:
ApiKeyAuth:
type: http
scheme: bearer
description: Static API key — pass as `Bearer <token>`.
schemas:
AffiliationPeriod:
type: object
required:
- organization
- startDate
- endDate
properties:
organization:
type: string
description: Name of the organization.
example: Linux Foundation
startDate:
type:
- string
- 'null'
format: date-time
description: Start date of the affiliation period (ISO 8601 datetime).
example: '2020-01-01T00:00:00.000Z'
endDate:
type:
- string
- 'null'
format: date-time
description: End date of the affiliation period, or null if currently active.
example: null
Contributor:
type: object
required:
- githubHandle
- name
- emails
- affiliations
properties:
githubHandle:
type: string
description: Verified GitHub login handle.
example: torvalds
name:
type:
- string
- 'null'
description: Display name from the LFX profile.
example: Linus Torvalds
emails:
type: array
description: Verified email addresses linked to the LFX profile.
items:
type: string
format: email
example:
- torvalds@linux-foundation.org
affiliations:
type: array
description: Resolved affiliation periods, ordered from most recent to oldest (null startDate last).
items:
$ref: '#/components/schemas/AffiliationPeriod'
BulkAffiliationsResponse:
type: object
required:
- total
- totalFound
- page
- pageSize
- contributorsInPage
- contributors
- notFound
properties:
total:
type: integer
description: Total number of handles submitted in the request.
example: 2
totalFound:
type: integer
description: Number of handles that matched an LFX profile.
example: 2
page:
type: integer
description: Current page number.
example: 1
pageSize:
type: integer
description: Maximum contributors per page.
example: 20
contributorsInPage:
type: integer
description: Number of contributors returned in this page.
example: 2
contributors:
type: array
items:
$ref: '#/components/schemas/Contributor'
notFound:
type: array
description: Handles from the request that had no matching LFX profile.
items:
type: string
example: []
HttpError:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
description: Machine-readable error code.
example: NOT_FOUND
message:
type: string
description: Human-readable error description.
example: Not found
responses:
BadRequest:
description: Invalid request body or query parameters.
content:
application/json:
schema:
$ref: '#/components/schemas/HttpError'
example:
error:
code: BAD_REQUEST
message: 'githubHandles: Maximum 100 handles per request'
Unauthorized:
description: Missing or invalid API key.
content:
application/json:
schema:
$ref: '#/components/schemas/HttpError'
example:
error:
code: UNAUTHORIZED
message: Invalid API key
Forbidden:
description: API key does not have the required scope.
content:
application/json:
schema:
$ref: '#/components/schemas/HttpError'
example:
error:
code: INSUFFICIENT_SCOPE
message: Insufficient scope for this operation
TooManyRequests:
description: Rate limit exceeded (60 requests per 60 seconds).
content:
application/json:
schema:
$ref: '#/components/schemas/HttpError'
example:
error:
code: RATE_LIMITED
message: Too many requests, please try again later