-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
547 lines (529 loc) · 13.1 KB
/
openapi.yaml
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
openapi: 3.0.3
info:
title: Sac Tech Job Board API
version: 0.1.0
description: OpenAPI specification for the Sac Tech Job Board API.
contact:
name: Robert Usher
url: https://github.com/sac-tech-org/job-board
email: [email protected]
servers:
- url: http://localhost:8080
description: Local server
tags:
- name: Health Check
- name: Job
- name: Organization
- name: User
paths:
/health:
get:
description: Health check endpoint
responses:
"200":
description: "Service is healthy"
content:
application/json:
schema:
$ref: "#/components/schemas/HealthCheck"
tags:
- Health Check
/job:
post:
operationId: postJob
description: Create a new job
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/JobPost"
required: true
responses:
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/JobResource"
description: "Job created"
links:
GetJobByID:
operationId: getJobByID
parameters:
id: "$response.body#/id"
description: The `id` value in the response is the `job_id` parameter in `GET /job/{job_id}`
tags:
- Job
/job/{job_id}:
parameters:
- name: job_id
in: path
required: true
schema:
type: string
format: uuid
get:
operationId: getJobByID
description: Get job by ID
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/JobResource"
description: GET Job object response
tags:
- Job
put:
operationId: putJobByID
description: Update job by ID
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/JobPost"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/JobResource"
description: PUT Job object response
tags:
- Job
/job/{job_id}/posting:
parameters:
- name: job_id
in: path
required: true
schema:
type: string
format: uuid
get:
operationId: getJobPosting
description: Get job posting by ID
parameters:
- $ref: "#/components/parameters/pageSizeQuery"
- $ref: "#/components/parameters/pageTokenQuery"
responses:
"200":
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/JobPostingResourceList"
description: GET Job posting response
tags:
- Job
post:
operationId: postJobPosting
description: Create a new job posting
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/JobPostingPost"
required: true
responses:
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/JobPostingResource"
description: "Job posting created"
links:
GetJobPostingByID:
operationId: getJobPostingByID
parameters:
id: "$response.body#/id"
description: The `id` value in the response is the `posting_id` parameter in `GET /job/{job_id}/posting/{posting_id}`
tags:
- Job
put:
operationId: putJobPostingByID
description: Update job posting by ID
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/JobPostingPost"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/JobPostingResource"
description: PUT Job posting object response
tags:
- Job
/job/posting:
get:
operationId: getJobPostingList
description: Get list of job postings
parameters:
- $ref: "#/components/parameters/pageSizeQuery"
- $ref: "#/components/parameters/pageTokenQuery"
responses:
"200":
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/JobPostingResourceList"
description: GET Job posting list response
tags:
- Job
/organization:
post:
operationId: postOrganization
description: Create a new organization
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/OrganizationPost"
required: true
responses:
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/OrganizationResource"
description: "Organization created"
links:
GetOrgByID:
operationId: getOrganizationByID
parameters:
id: "$response.body#/id"
description: The `id` value in the response is the `org_id` parameter in `GET /organization/{org_id}`
tags:
- Organization
/organization/{org_id}:
parameters:
- name: org_id
in: path
required: true
schema:
type: string
format: uuid
get:
operationId: getOrganizationByID
description: Get organization by ID
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/OrganizationResource"
description: GET Organization object response
tags:
- Organization
put:
operationId: putOrganizationByID
description: Update organization by ID
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/OrganizationPost"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/OrganizationResource"
description: PUT Organization object response
tags:
- Organization
/organization/jobs:
get:
operationId: getOrganizationJobList
description: Get list of jobs for an organization
parameters:
- $ref: "#/components/parameters/pageSizeQuery"
- $ref: "#/components/parameters/pageTokenQuery"
responses:
"200":
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/JobResourceList"
description: GET Job list response
tags:
- Organization
/user:
get:
operationId: getUserList
description: Get list of users
responses:
"200":
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/UserResource"
description: GET User list response
tags:
- User
/user/me:
get:
operationId: getCurrentUser
description: Get current user
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/UserResource"
description: GET User object response
tags:
- User
/user/{username}:
parameters:
- $ref: "#/components/parameters/usernamePath"
delete:
operationId: deleteUserByID
description: Delete user by ID
responses:
"204":
description: "User succussfully deleted"
tags:
- User
get:
operationId: getUserByUsername
description: Get user by Username
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/UserResource"
description: GET User object response
tags:
- User
put:
operationId: putUserByID
description: Update user by ID
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UserUpdatePut"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/UserResource"
description: PUT User object response
tags:
- User
components:
parameters:
pageSizeQuery:
in: query
name: Page Size
required: true
schema:
type: integer
format: int32
minimum: 1
maximum: 100
pageTokenQuery:
in: query
name: Page Token
required: false
schema:
type: string
usernamePath:
description: Username
in: path
name: username
required: true
schema:
type: string
schemas:
EmailObject:
type: object
properties:
address:
type: string
format: email
verified:
type: boolean
HealthCheck:
type: object
properties:
status:
type: string
enum:
- ok
JobResource:
type: object
properties:
id:
type: string
format: uuid
title:
type: string
description:
type: string
organization:
type: string
format: uuid
JobResourceList:
allOf:
- $ref: "#/components/schemas/PaginationResponse"
- type: object
properties:
jobs:
type: array
items:
$ref: "#/components/schemas/JobResource"
JobPost:
type: object
properties:
title:
type: string
description:
type: string
JobPostingPost:
type: object
properties:
employmentType:
type: string
enum:
- full-time
- part-time
- contract
- temporary
- internship
- volunteer
- per-diem
- other
payRate:
type: number
format: float
payType:
type: string
enum:
- hourly
- salary
- commission
- other
startDate:
type: string
format: date
endDate:
type: string
format: date
publishOverride:
type: boolean
JobPostingResource:
type: object
properties:
employmentType:
type: string
enum:
- full-time
- part-time
- contract
- temporary
- internship
- volunteer
- per-diem
- other
payRate:
type: number
format: float
payType:
type: string
enum:
- hourly
- salary
- commission
- other
startDate:
type: string
format: date
endDate:
type: string
format: date
publishOverride:
type: boolean
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
JobPostingResourceList:
allOf:
- $ref: "#/components/schemas/PaginationResponse"
- type: object
properties:
postings:
type: array
items:
$ref: "#/components/schemas/JobPostingResource"
OrganizationResource:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
description:
type: string
website:
type: string
format: uri
OrganizationPost:
type: object
properties:
name:
type: string
description:
type: string
website:
type: string
format: uri
PaginationResponse:
type: object
properties:
nextPageToken:
type: string
UserResource:
type: object
properties:
email:
$ref: "#/components/schemas/EmailObject"
id:
type: string
format: uuid
firstName:
type: string
lastName:
type: string
username:
type: string
maxLength: 24
UserUpdatePut:
type: object
properties:
firstName:
type: string
lastName:
type: string
username:
type: string
maxLength: 24