-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
836 lines (836 loc) · 22.5 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
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
swagger: '2.0'
info:
title: Game Curator API
description: Learning project API to retrieve and manipulate game review data.
version: v1
license:
name: GNU Affero General Public License Version 3
url: http://www.gnu.org/licenses/agpl-3.0.en.html
contact:
name: IS Data Architecture Team
url: https://is.oregonstate.edu/data-architecture
email: isdataarchitecture@oregonstate.edu
schemes:
- http
host: api.oregonstate.edu
basePath: /v1
externalDocs:
description: GitHub Repository
url: https://github.com/osu-mist/game-curator-api
produces:
- application/json
consumes:
- application/json
paths:
/games:
parameters:
- $ref: '#/parameters/authorization'
get:
summary: List all games
description: Get all games
operationId: getGames
tags:
- games
parameters:
- $ref: '#/parameters/pageNumber'
- $ref: '#/parameters/pageSize'
- name: developerId
in: query
type: string
required: false
description: Id of developer to return games from
- name: name
in: query
type: string
required: false
description: Name of game to return
- $ref: '#/parameters/scoreMin'
- $ref: '#/parameters/scoreMax'
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/GameResults'
'400':
description: Bad request
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
post:
summary: Add a new game
operationId: createGame
tags:
- games
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/GamePostBody'
responses:
'201':
description: Successfully added a game
schema:
$ref: '#/definitions/GameResult'
'400':
description: Bad request
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
/games/{gameId}:
parameters:
- $ref: '#/parameters/authorization'
- name: gameId
in: path
description: Id of game to return
required: true
type: string
pattern: '^\d+$'
get:
summary: Find game by ID
description: Returns a single game
operationId: getGameById
tags:
- games
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/GameResult'
'404':
description: Game not found
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
patch:
summary: Update information on a game
description: Pass in parameters to update fields on game resources
operationId: updateGameById
tags:
- games
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/GamePatchBody'
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/GameResult'
'400':
description: Bad request
schema:
$ref: '#/definitions/Errors'
'404':
description: Game not found
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
delete:
summary: Delete a game
description: Delete a game by passing in a gameId
operationId: deleteGameById
tags:
- games
responses:
'204':
description: Game deleted successfully
'404':
description: Game not found
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
/developers:
parameters:
- $ref: '#/parameters/authorization'
get:
summary: Get complete or filtered list of developers
description: Retrieve complete list of developers or pass in query parameters to filter results
operationId: getDevelopers
tags:
- developers
parameters:
- $ref: '#/parameters/pageNumber'
- $ref: '#/parameters/pageSize'
- name: name
in: query
type: string
description: Name of the developer
responses:
'200':
description: Completed successfully
schema:
$ref: '#/definitions/DeveloperResults'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
post:
summary: Create a new developer record
description: Pass JSON containing the required parameters to create a new developer record
operationId: createDeveloper
tags:
- developers
parameters:
- in: body
name: body
required: true
schema:
$ref: '#/definitions/DeveloperPostBody'
responses:
'201':
description: Developer created successfully
schema:
$ref: '#/definitions/DeveloperResult'
'400':
description: Invalid developer object
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
/developers/{developerId}:
parameters:
- $ref: '#/parameters/authorization'
- name: developerId
in: path
type: string
required: true
description: Unique id of a developer record
pattern: '^\d+$'
get:
summary: Get developer by its Id
operationId: getDeveloperById
tags:
- developers
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/DeveloperResult'
'404':
description: Developer not found
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
patch:
summary: Update developer by its Id
operationId: updateDeveloperById
tags:
- developers
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/DeveloperPatchBody'
responses:
'200':
description: Developer updated successfully
schema:
$ref: '#/definitions/DeveloperResult'
'400':
description: Bad request
schema:
$ref: '#/definitions/Errors'
'404':
description: Developer not found
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
delete:
summary: Delete a developer record
operationId: deleteDeveloperById
tags:
- developers
responses:
'204':
description: Developer deleted successfully
'404':
description: Developer not found
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
/reviews:
parameters:
- $ref: '#/parameters/authorization'
get:
summary: List all reviews
description: Get a list of all reviews or filter by query parameters
operationId: getReviews
tags:
- reviews
parameters:
- $ref: '#/parameters/pageNumber'
- $ref: '#/parameters/pageSize'
- $ref: '#/parameters/gameIds'
- name: reviewer
in: query
type: string
required: false
description: Filter by the name of the game reviewer
- $ref: '#/parameters/scoreMin'
- $ref: '#/parameters/scoreMax'
- name: reviewDate
in: query
type: string
format: date
required: false
description: 'Filter results by posting date. Example: reviewDate=2019-12-30'
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/ReviewResults'
'400':
description: Bad request
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
post:
summary: Create a review
description: Post score and review text to create a review
operationId: createReview
tags:
- reviews
parameters:
- in: body
name: requestBody
required: true
schema:
$ref: '#/definitions/ReviewPostBody'
responses:
'201':
description: Successfully created new review
schema:
$ref: '#/definitions/ReviewResult'
'400':
description: Invalid review object
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
/reviews/{reviewId}:
parameters:
- $ref: '#/parameters/authorization'
- name: reviewId
in: path
description: Id of review to return
required: true
type: string
pattern: '^\d+$'
get:
summary: Find review by Id
description: Returns all reviews that belong to a particular game
operationId: getReviewById
tags:
- reviews
responses:
'200':
description: Successful response
schema:
$ref: '#/definitions/ReviewResult'
'404':
description: Review not found
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
patch:
summary: Update a review
description: Update a review by passing in the reviewId and the parameters to update
operationId: updateReviewById
tags:
- reviews
parameters:
- name: body
in: body
schema:
$ref: '#/definitions/ReviewPatchBody'
responses:
'200':
description: Game update successful
schema:
$ref: '#/definitions/ReviewResult'
'400':
description: Bad request
schema:
$ref: '#/definitions/Errors'
'404':
description: Review not found
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
delete:
summary: Delete review
description: Delete the review with the passed in reviewId
operationId: deleteReviewById
tags:
- reviews
responses:
'204':
description: Review deleted successfully
'404':
description: Review not found
schema:
$ref: '#/definitions/Errors'
'500':
description: Internal server error
schema:
$ref: '#/definitions/Errors'
parameters:
authorization:
name: Authorization
in: header
type: string
required: true
description: '"Bearer [token]" where [token] is your OAuth2 access token'
pageNumber:
name: page[number]
in: query
type: integer
required: false
description: Page number of results
default: 1
minimum: 1
pageSize:
name: page[size]
in: query
type: integer
required: false
description: Number of results to return
default: 25
maximum: 500
minimum: 1
gameIds:
name: gameIds
in: query
type: array
items:
type: integer
collectionFormat: csv
required: false
description: 'Filter by the Id of the game. Example: gameIds=1,2,3'
scoreMin:
name: scoreMin
in: query
type: number
format: float
required: false
minimum: 1
maximum: 5
description: Filter results by minimum review score
scoreMax:
name: scoreMax
in: query
type: number
format: float
required: false
minimum: 1
maximum: 5
description: Filter results by maximum review score
definitions:
Meta:
properties:
totalResults:
type: integer
description: Total number of results
example: 10
totalPages:
type: integer
description: Total number of pages
example: 10
currentPageNumber:
type: integer
description: Page number of the returned results
example: 1
currentPageSize:
type: integer
description: Number of results per page
example: 25
GameResource:
properties:
id:
type: string
pattern: '^\d+$'
type:
$ref: '#/definitions/GameType'
links:
$ref: '#/definitions/SelfLink'
attributes:
type: object
properties:
developerId:
$ref: '#/definitions/DeveloperResource/properties/id'
name:
type: string
description: Name of the game
example: Eternal Death Slayer 3
score:
type: number
format: float
description: Composite review score of this game out of 5
example: 4.5
releaseDate:
type: string
format: date
description: Date of the games release
example: "1994-12-5"
GameResult:
properties:
links:
$ref: '#/definitions/SelfLink'
data:
$ref: '#/definitions/GameResource'
GameResults:
properties:
links:
allOf:
- $ref: '#/definitions/SelfLink'
- $ref: '#/definitions/PaginationLinks'
meta:
$ref: '#/definitions/Meta'
data:
type: array
items:
$ref: '#/definitions/GameResource'
GamePostBody:
properties:
data:
type: object
properties:
type:
$ref: '#/definitions/GameType'
attributes:
type: object
properties:
name:
$ref: '#/definitions/GameResource/properties/attributes/properties/name'
releaseDate:
$ref: '#/definitions/GameResource/properties/attributes/properties/releaseDate'
developerId:
$ref: '#/definitions/DeveloperResource/properties/id'
required:
- name
- releaseDate
- developerId
additionalProperties: false
required:
- type
- attributes
required:
- data
GamePatchBody:
properties:
data:
type: object
properties:
id:
$ref: '#/definitions/GameResource/properties/id'
type:
$ref: '#/definitions/GameType'
attributes:
type: object
properties:
name:
$ref: '#/definitions/GameResource/properties/attributes/properties/name'
releaseDate:
$ref: '#/definitions/GameResource/properties/attributes/properties/releaseDate'
additionalProperties: false
required:
- id
- type
- attributes
required:
- data
DeveloperResource:
properties:
id:
type: string
pattern: '^\d+$'
type:
$ref: '#/definitions/DeveloperType'
links:
$ref: '#/definitions/SelfLink'
attributes:
type: object
properties:
name:
type: string
description: Name of the developer
example: Terminal Reality
website:
type: string
format: url
description: Url to homepage of developer
example: https://bethesda.net/
DeveloperResult:
properties:
links:
$ref: '#/definitions/SelfLink'
data:
$ref: '#/definitions/DeveloperResource'
DeveloperResults:
properties:
links:
allOf:
- $ref: '#/definitions/SelfLink'
- $ref: '#/definitions/PaginationLinks'
meta:
$ref: '#/definitions/Meta'
data:
type: array
items:
$ref: '#/definitions/DeveloperResource'
DeveloperPostBody:
properties:
data:
type: object
properties:
type:
$ref: '#/definitions/DeveloperType'
attributes:
type: object
properties:
name:
$ref: '#/definitions/DeveloperResource/properties/attributes/properties/name'
website:
$ref: '#/definitions/DeveloperResource/properties/attributes/properties/website'
required:
- name
- website
additionalProperties: false
required:
- type
- attributes
required:
- data
DeveloperPatchBody:
properties:
data:
type: object
properties:
type:
$ref: '#/definitions/DeveloperType'
id:
$ref: '#/definitions/DeveloperResource/properties/id'
attributes:
type: object
properties:
name:
$ref: '#/definitions/DeveloperResource/properties/attributes/properties/name'
website:
$ref: '#/definitions/DeveloperResource/properties/attributes/properties/website'
required:
- type
- id
- attributes
required:
- data
ReviewResource:
properties:
id:
type: string
pattern: '^\d+$'
type:
$ref: '#/definitions/ReviewType'
links:
$ref: '#/definitions/SelfLink'
attributes:
type: object
properties:
gameId:
$ref: '#/definitions/GameResource/properties/id'
reviewer:
type: string
description: Person who wrote the review.
example: Commander Shepard
score:
type: number
format: float
description: Score for this review out of 5
example: 4.5
reviewText:
type: string
description: Text containing the review for the referenced game
example: My name is Commander Shepard and this is my favorite game on the citadel.
reviewDate:
type: string
format: date
description: Date the review was finalized
example: "1994-12-5"
ReviewResult:
properties:
links:
$ref: '#/definitions/SelfLink'
data:
$ref: '#/definitions/ReviewResource'
ReviewResults:
properties:
links:
allOf:
- $ref: '#/definitions/SelfLink'
- $ref: '#/definitions/PaginationLinks'
meta:
$ref: '#/definitions/Meta'
data:
type: array
items:
$ref: '#/definitions/ReviewResource'
ReviewPostBody:
properties:
data:
type: object
properties:
type:
$ref: '#/definitions/ReviewType'
attributes:
type: object
properties:
gameId:
$ref: '#/definitions/ReviewResource/properties/attributes/properties/gameId'
reviewText:
$ref: '#/definitions/ReviewResource/properties/attributes/properties/reviewText'
score:
$ref: '#/definitions/ReviewResource/properties/attributes/properties/score'
reviewer:
$ref: '#/definitions/ReviewResource/properties/attributes/properties/reviewer'
required:
- gameId
- reviewText
- score
- reviewer
additionalProperties: false
required:
- type
- attributes
required:
- data
ReviewPatchBody:
properties:
data:
type: object
properties:
type:
$ref: '#/definitions/ReviewType'
id:
$ref: '#/definitions/ReviewResource/properties/id'
attributes:
type: object
properties:
reviewText:
$ref: '#/definitions/ReviewResource/properties/attributes/properties/reviewText'
score:
$ref: '#/definitions/ReviewResource/properties/attributes/properties/score'
reviewer:
$ref: '#/definitions/ReviewResource/properties/attributes/properties/reviewer'
additionalProperties: false
required:
- type
- id
- attributes
required:
- data
GameType:
type: string
enum:
- game
DeveloperType:
type: string
enum:
- developer
ReviewType:
type: string
enum:
- review
SelfLink:
properties:
self:
type: string
format: url
description: Self-link of current resource
PaginationLinks:
properties:
first:
type: string
format: url
description: The first page of data
last:
type: string
format: url
description: The last page of data
prev:
type: string
format: url
description: The previous page of data
next:
type: string
format: url
description: The next page of data
Error:
properties:
status:
type: string
description: HTTP status code
example: '123'
title:
type: string
description: A short, user readable summary of the error
example: Not Found
code:
type: string
description: An application-specific error code
example: '1234'
detail:
type: string
description: A long description of the error that may contain instance-specific details
links:
properties:
about:
type: string
format: url
description: A link to further information about the error
example: https://developer.oregonstate.edu/documentation/error-reference#1234
Errors:
properties:
errors:
type: array
items:
$ref: '#/definitions/Error'