-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
71 lines (71 loc) · 2.09 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
openapi: 3.0.0
info:
version: 1.0.0
title: Gateway Service
description: A service acting as a gate to prevent attacks.
paths:
/game:
get:
description: Returns a brand new game.
operationId: Start Game.
parameters:
- in: query
name: deck
schema:
type: string
description: Optional parameter specify a type of deck (e.g. nsfw)
responses:
'200':
description: Return a brand new game with new random cards.
content:
application/json:
schema:
type: array
items:
$ref: '../types.yaml#/components/schemas/Game'
"404":
description: Resource not found, error return in case of attack.
content:
application/json:
schema:
$ref: "../types.yaml#/components/schemas/Error"
default:
description: unexpected error
content:
application/json:
schema:
$ref: '../types.yaml#/components/schemas/Error'
/submit:
post:
description: Submit a game outcome.
requestBody:
required: true
content:
application/json:
schema:
$ref: "../types.yaml#/components/schemas/Game"
responses:
"200":
description: Successful handling.
content:
application/json:
schema:
$ref: "../types.yaml#/components/schemas/Result"
"401":
description: Expired or malformed token.
content:
application/json:
schema:
$ref: "../types.yaml#/components/schemas/Error"
"403":
description: Duplicate game submission.
content:
application/json:
schema:
$ref: "../types.yaml#/components/schemas/Error"
"500":
description: Internal Error.
content:
application/json:
schema:
$ref: "../types.yaml#/components/schemas/Error"