Repository navigation
Expand file tree
/
Copy pathswagger.yaml
More file actions
116 lines (116 loc) · 2.96 KB
/
Copy pathswagger.yaml
File metadata and controls
116 lines (116 loc) · 2.96 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
swagger: '2.0'
info:
version: '1.0.0'
title: 'CodeUp REST API'
description: 'REST API for CodeUp'
contact:
email: 'ben@codeup.space'
name: 'Ben Siebert'
url: 'https://codeup.space/codeup/contact'
host: "codeup.space"
basePath: "/api"
securityDefinitions:
JWT:
type: apiKey
name: X-JWT
in: header
description: 'JWT token'
paths:
/challenges:
get:
summary: 'Get all challenges'
description: 'Returns all challenges'
operationId: 'getChallenges'
security:
- JWT: []
parameters:
- name: 'id'
type: string
in: query
description: 'ID of the challenge'
required: false
responses:
'200':
description: 'Successful operation'
schema:
type: object
properties:
status:
type: number
description: 'Status code'
payload:
$ref: '#/definitions/CodeChallenge'
/challenges/completed:
get:
summary: 'Get all completed challenges'
description: 'Returns all completed challenges'
operationId: 'getCompletedChallenges'
security:
- JWT: []
responses:
'200':
description: 'Successful operation'
schema:
type: object
properties:
status:
type: number
description: 'Status code'
payload:
type: array
items:
$ref: '#/definitions/CodeChallenge'
/challenges/check:
post:
summary: 'Check a challenge'
description: 'Checks a challenge'
operationId: 'checkChallenge'
security:
- JWT: []
parameters:
- name: 'challengeId'
type: string
in: body
description: 'ID of the challenge'
required: true
- name: 'code'
type: string
in: body
description: 'Code to check'
required: true
- name: 'language'
type: string
in: body
description: 'Language of the code'
required: true
responses:
'200':
description: 'Successful operation'
schema:
type: object
properties:
status:
type: number
description: 'Status code'
message:
type: string
description: 'The returned message'
definitions:
CodeChallenge:
type: object
properties:
createdAt:
type: string
description: 'Date the challenge was created'
difficulty:
type: number
description: 'Difficulty of the challenge'
title:
type: string
description: 'Title of the challenge'
task:
type: string
description: 'Task of the challenge'
expectedOutput:
type: string
description: 'Expected output of the challenge'